diff --git a/command/arg_test.go b/command/arg_test.go index e99d1a5..54b61b3 100644 --- a/command/arg_test.go +++ b/command/arg_test.go @@ -44,6 +44,11 @@ func (m *MockArg) Apply(cli safecli.CommandAppender) error { func TestArguments(t *testing.T) { check.TestingT(t) } var _ = check.Suite(&test.ArgumentSuite{Cmd: "cmd", Arguments: []test.ArgumentTest{ + { + Name: "NewArguments with NoopArgument", + Argument: command.NewNoopArgument(), + ExpectedCLI: []string{"cmd"}, + }, { Name: "NewErrorArgument without error", Argument: command.NewErrorArgument(nil), diff --git a/command/option_arg.go b/command/option_arg.go index 35dbf60..942809f 100644 --- a/command/option_arg.go +++ b/command/option_arg.go @@ -41,8 +41,6 @@ func (o optionArg) Apply(cmd safecli.CommandAppender) error { func newOptionArg(name, arg string, isArgRedacted bool) Applier { if err := validateOptionName(name); err != nil { return err - } else if arg == "" { - return noopArgument{} } return optionArg{ name: name, diff --git a/command/option_arg_test.go b/command/option_arg_test.go index 6835ca6..6277bb4 100644 --- a/command/option_arg_test.go +++ b/command/option_arg_test.go @@ -43,7 +43,7 @@ var _ = check.Suite(&test.ArgumentSuite{Cmd: "cmd", Arguments: []test.ArgumentTe { Name: "NewOptionWithArgument with empty argument", Argument: command.NewOptionWithArgument("--option", ""), - ExpectedCLI: []string{"cmd"}, + ExpectedCLI: []string{"cmd", "--option="}, }, { @@ -65,6 +65,7 @@ var _ = check.Suite(&test.ArgumentSuite{Cmd: "cmd", Arguments: []test.ArgumentTe { Name: "NewOptionWithRedactedArgument with empty argument", Argument: command.NewOptionWithRedactedArgument("--option", ""), - ExpectedCLI: []string{"cmd"}, + ExpectedCLI: []string{"cmd", "--option="}, + ExpectedLog: "cmd --option=<****>", }, }})