gsscoder / commandline

Terse syntax C# command line parser for .NET with F# support
1.63k stars 293 forks source link

Bugfix: Parameter name matches previous parameter value #491

Closed glenebob closed 7 years ago

glenebob commented 7 years ago

When processing scalar tokens, use the correct grouping routine.

This fixes a strange bug where a parameter name matching the previous parameter values causes the second parameter value to match it's name. Consider these two command lines:

var works = new string[] { "--argument1", "argument1Value", "--argument2", "argument2Value" };` var doesNotWork = new string[] { "--argument1", "argument2", "--argument2", "argument2Value" };

After parsing doesNotWork, the value of --argument2 will be "argument2", instead of the expected "argument2Value".

nemec commented 7 years ago

Thanks, that seems to fix the issue!