|
|
@ -61,8 +61,13 @@ func TestParseAndRunShortOpts(t *testing.T) {
|
|
|
|
{testArgs: args{"foo", "test", "-af"}, expectedErr: nil, expectedArgs: &args{}},
|
|
|
|
{testArgs: args{"foo", "test", "-af"}, expectedErr: nil, expectedArgs: &args{}},
|
|
|
|
{testArgs: args{"foo", "test", "-cf"}, expectedErr: nil, expectedArgs: &args{}},
|
|
|
|
{testArgs: args{"foo", "test", "-cf"}, expectedErr: nil, expectedArgs: &args{}},
|
|
|
|
{testArgs: args{"foo", "test", "-acf"}, expectedErr: nil, expectedArgs: &args{}},
|
|
|
|
{testArgs: args{"foo", "test", "-acf"}, expectedErr: nil, expectedArgs: &args{}},
|
|
|
|
|
|
|
|
{testArgs: args{"foo", "test", "--acf"}, expectedErr: errors.New("flag provided but not defined: -acf"), expectedArgs: nil},
|
|
|
|
{testArgs: args{"foo", "test", "-invalid"}, expectedErr: errors.New("flag provided but not defined: -invalid"), expectedArgs: nil},
|
|
|
|
{testArgs: args{"foo", "test", "-invalid"}, expectedErr: errors.New("flag provided but not defined: -invalid"), expectedArgs: nil},
|
|
|
|
|
|
|
|
{testArgs: args{"foo", "test", "-acf", "-invalid"}, expectedErr: errors.New("flag provided but not defined: -invalid"), expectedArgs: nil},
|
|
|
|
|
|
|
|
{testArgs: args{"foo", "test", "--invalid"}, expectedErr: errors.New("flag provided but not defined: -invalid"), expectedArgs: nil},
|
|
|
|
|
|
|
|
{testArgs: args{"foo", "test", "-acf", "--invalid"}, expectedErr: errors.New("flag provided but not defined: -invalid"), expectedArgs: nil},
|
|
|
|
{testArgs: args{"foo", "test", "-acf", "arg1", "-invalid"}, expectedErr: nil, expectedArgs: &args{"arg1", "-invalid"}},
|
|
|
|
{testArgs: args{"foo", "test", "-acf", "arg1", "-invalid"}, expectedErr: nil, expectedArgs: &args{"arg1", "-invalid"}},
|
|
|
|
|
|
|
|
{testArgs: args{"foo", "test", "-acf", "arg1", "--invalid"}, expectedErr: nil, expectedArgs: &args{"arg1", "--invalid"}},
|
|
|
|
{testArgs: args{"foo", "test", "-acfi", "not-arg", "arg1", "-invalid"}, expectedErr: nil, expectedArgs: &args{"arg1", "-invalid"}},
|
|
|
|
{testArgs: args{"foo", "test", "-acfi", "not-arg", "arg1", "-invalid"}, expectedErr: nil, expectedArgs: &args{"arg1", "-invalid"}},
|
|
|
|
{testArgs: args{"foo", "test", "-i", "ivalue"}, expectedErr: nil, expectedArgs: &args{}},
|
|
|
|
{testArgs: args{"foo", "test", "-i", "ivalue"}, expectedErr: nil, expectedArgs: &args{}},
|
|
|
|
{testArgs: args{"foo", "test", "-i", "ivalue", "arg1"}, expectedErr: nil, expectedArgs: &args{"arg1"}},
|
|
|
|
{testArgs: args{"foo", "test", "-i", "ivalue", "arg1"}, expectedErr: nil, expectedArgs: &args{"arg1"}},
|
|
|
|