Incorrect parsing of multiple string switches
Brought to you by:
robsmyth
When trying to parse
app.exe -a "aaa" -b "bbb"
the value of switch a becomes
aaa" -b "bbb
This is caused by an incorrect regex in the function initialise in class StringSwitch. The line
this.valuePattern = @")((?:"")(?<value>.+)(?:"")|(?<value>\S+))";
should be replaced with
this.valuePattern = @")((?:"")(?<value>[^""]+)(?:"")|(?<value>\S+))";
EJ