Jean-Marc Lasgouttes wrote: > What I was not sure about is how you handle option=='foo bar'.
We don't. All hell breaks loose at this point and always has. The existing code to split a string up into an argv array is: char *argv[MAX_ARGV]; string line = command_; int index = 0; for (; index < MAX_ARGV-1; ++index) { string word; line = split(line, word, ' '); if (word.empty()) break; char * tmp = new char[word.length() + 1]; word.copy(tmp, word.length()); tmp[word.length()] = '\0'; argv[index] = tmp; } argv[index] = 0; Ie, we assume that ' ' marks the gap between arguments in the string. To do this properly requires a fully-formed parser of the sh language. Which I've written but *am not* proposing to add to LyX 1.3.x. What we could reasonably do is to modify the above approach so that, if the word starts with ' then we search for "' " as the end of the word. Ditto for " quotes. That would work for most cases I think. Including the LibScriptSearch case. What do you think? -- Angus