grunt
grunt copied to clipboard
Improperly split arguments
The provided arguments in this call:
grunt task:arg1:"arg2 with spaces":"arg3 : blah"
Should be split out into "arg1"
, "arg2 with spaces"
, and "arg3 : blah"
, but they will actually be split out into "arg1"
, "arg2 with spaces"
, "arg3
, and blah"
because of the colon inside of arg3
I realize this is a bit of an edge case, and I've only encountered it as a problem this one time.
That's more about how the command line is parsed in general on Unix/Linux. Note this result on the command line:
> node -e "console.log(process.argv)" task:arg1:"arg2 with spaces":"arg3 : blah"
[ 'C:\\Program Files\\nodejs\\node.exe', 'task:arg1:arg2 with spaces:arg3 : blah' ]
Notice how there is only one argument. The quoting prevents spaces from starting a new arg in the shell, but the shell removes those quotes before node/Grunt gets the command line.
It looks like colons can be escaped using a backslash but that never made it into the docs, so this is probably just a docs issue.
cc @JKAussieSkater
Awesome, noted!