This commit is contained in:
Michael Schuett 2019-01-27 01:44:36 -05:00
parent ff1c0b58dd
commit 7c383b0d16
3 changed files with 13 additions and 13 deletions

View File

@ -266,7 +266,7 @@ func reorderArgs(args []string) []string {
}
func translateShortOptions(set *flag.FlagSet, flagArgs Args) []string {
allCharsFlags := func (s string) bool {
allCharsFlags := func(s string) bool {
for i := range s {
f := set.Lookup(string(s[i]))
if f == nil {

View File

@ -71,7 +71,7 @@ func TestParseAndRunShortOpts(t *testing.T) {
{[]string{"foo", "test", "-cf"}, nil, []string{}},
{[]string{"foo", "test", "-acf"}, nil, []string{}},
{[]string{"foo", "test", "-invalid"}, errors.New("flag provided but not defined: -invalid"), []string{}},
{[]string{"foo", "test", "-acf", "arg1", "-invalid"}, nil, []string{"arg1" ,"-invalid"}},
{[]string{"foo", "test", "-acf", "arg1", "-invalid"}, nil, []string{"arg1", "-invalid"}},
}
var args []string