Handle ShortOptions and SkipArgReorder

There was a bug in parsing when both ShortOptions
and SkipArgReorder were being used together.

Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
baude
2017-11-20 09:32:03 -06:00
parent c6af8847eb
commit ceaac7c915
2 changed files with 87 additions and 43 deletions

View File

@@ -22,6 +22,7 @@ func TestCommandFlagParsing(t *testing.T) {
// Test no arg reorder
{[]string{"test-cmd", "blah", "blah", "-break"}, false, true, nil, false},
{[]string{"test-cmd", "blah", "blah", "-break", "ls", "-l"}, false, true, nil, true},
{[]string{"test-cmd", "blah", "blah"}, true, false, nil, false}, // Test SkipFlagParsing without any args that look like flags
{[]string{"test-cmd", "blah", "-break"}, true, false, nil, false}, // Test SkipFlagParsing with random flag arg