diff --git a/command_test.go b/command_test.go index 9e53ed3681..86a730479c 100644 --- a/command_test.go +++ b/command_test.go @@ -140,12 +140,13 @@ func TestParseAndRunHyphenValues(t *testing.T) { {[]string{"foo", "test", "--opt", "--opt-value", "arg1", "arg2"}, []string{"arg1", "arg2"}, "--opt-value"}, {[]string{"foo", "test", "arg1", "--opt", "--opt-value"}, []string{"arg1"}, "--opt-value"}, {[]string{"foo", "test", "arg1", "--opt", "--opt-value", "arg2"}, []string{"arg1", "arg2"}, "--opt-value"}, - - {[]string{"foo", "test", "--", "arg1", "--opt", "--opt-value", "arg2"}, []string{""}, ""}, - {[]string{"foo", "test", "arg1", "--", "--opt", "--opt-value", "arg2"}, []string{"arg1"}, ""}, - {[]string{"foo", "test", "arg1", "--opt", "--", "--opt-value", "arg2"}, []string{"arg1"}, ""}, - {[]string{"foo", "test", "arg1", "--opt", "--opt-value", "--", "arg2"}, []string{"arg1"}, "--opt-value"}, - {[]string{"foo", "test", "arg1", "--opt", "--opt-value", "arg2", "--"}, []string{"arg1", "arg2"}, "--opt-value"}, + + {[]string{"foo", "test", "--", "--opt", "--opt-value", "arg1"}, []string{"--", "--opt", "--opt-value", "arg1"}, ""}, + {[]string{"foo", "test", "--", "arg1", "--opt", "--opt-value", "arg2"}, []string{"--", "arg1", "--opt", "--opt-value", "arg2"}, ""}, + {[]string{"foo", "test", "arg1", "--", "--opt", "--opt-value", "arg2"}, []string{"arg1", "--", "--opt", "--opt-value", "arg2"}, ""}, + {[]string{"foo", "test", "arg1", "--opt", "--", "--opt-value", "arg2"}, []string{"arg1", "--", "--opt-value", "arg2"}, ""}, + {[]string{"foo", "test", "arg1", "--opt", "--opt-value", "--", "arg2"}, []string{"arg1", "--", "arg2"}, "--opt-value"}, + {[]string{"foo", "test", "arg1", "--opt", "--opt-value", "arg2", "--"}, []string{"arg1", "arg2", "--"}, "--opt-value"}, } for _, tc := range cases {