diff --git a/command.go b/command.go index 1e41557..eb311a7 100644 --- a/command.go +++ b/command.go @@ -827,7 +827,7 @@ func (c *Command) validateRequiredFlags() error { }) if len(missingFlagNames) > 0 { - return fmt.Errorf(`Required flag(s) "%s" have/has not been set`, strings.Join(missingFlagNames, `", "`)) + return fmt.Errorf(`required flag(s) "%s" not set`, strings.Join(missingFlagNames, `", "`)) } return nil } diff --git a/command_test.go b/command_test.go index edffc15..dc8f2af 100644 --- a/command_test.go +++ b/command_test.go @@ -681,7 +681,7 @@ func TestRequiredFlags(t *testing.T) { c.MarkFlagRequired("foo2") c.Flags().String("bar", "", "") - expected := fmt.Sprintf("Required flag(s) %q, %q have/has not been set", "foo1", "foo2") + expected := fmt.Sprintf("required flag(s) %q, %q not set", "foo1", "foo2") _, err := executeCommand(c) got := err.Error() @@ -708,7 +708,7 @@ func TestPersistentRequiredFlags(t *testing.T) { parent.AddCommand(child) - expected := fmt.Sprintf("Required flag(s) %q, %q, %q, %q have/has not been set", "bar1", "bar2", "foo1", "foo2") + expected := fmt.Sprintf("required flag(s) %q, %q, %q, %q not set", "bar1", "bar2", "foo1", "foo2") _, err := executeCommand(parent, "child") if err.Error() != expected {