1 // take an un-split argv string and tokenize it.
2 module.exports = function (argString) {
8 for (var ii = 0; ii < argString.length; ii++) {
9 c = argString.charAt(ii)
11 // split on spaces unless we're in quotes.
12 if (c === ' ' && !opening) {
17 // don't split the string if we're in matching
18 // opening or closing single and double quotes.
22 } else if ((c === "'" || c === '"') && !opening) {
27 if (!args[i]) args[i] = ''