Hey,
I always make a small error when I post some code. I forgot to dup the
commandLine string in my previous post. This is what it should have been:
def parseCommandLine(aString)
unparsedCommands=aString.dup # need dup here point is to not mutate
string arg
parsedCommands = []
while # remove commands from unparsedCommands as we find them
unparsedCommands.sub!(/([a-zA-Z0-9]+)|"(\"|[^"])*"/) { parsedCommands <<
$&; ""}
end
return parsedCommands
end