From 4a7a5f3a57a967c0dd0658658c96c21b8c172d29 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Sat, 4 Jun 2016 16:19:54 +0200 Subject: [PATCH] Display "See 'docker cmd --help'." in error cases This brings back this message in case missing arguments. Signed-off-by: Vincent Demeester --- required.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/required.go b/required.go index b3ebb9ba9f..1bbd55f524 100644 --- a/required.go +++ b/required.go @@ -18,7 +18,8 @@ func NoArgs(cmd *cobra.Command, args []string) error { } return fmt.Errorf( - "\"%s\" accepts no argument(s).\n\nUsage: %s\n\n%s", + "\"%s\" accepts no argument(s).\nSee '%s --help'.\n\nUsage: %s\n\n%s", + cmd.CommandPath(), cmd.CommandPath(), cmd.UseLine(), cmd.Short, @@ -32,9 +33,10 @@ func RequiresMinArgs(min int) cobra.PositionalArgs { return nil } return fmt.Errorf( - "\"%s\" requires at least %d argument(s).\n\nUsage: %s\n\n%s", + "\"%s\" requires at least %d argument(s).\nSee '%s --help'.\n\nUsage: %s\n\n%s", cmd.CommandPath(), min, + cmd.CommandPath(), cmd.UseLine(), cmd.Short, ) @@ -48,9 +50,10 @@ func ExactArgs(number int) cobra.PositionalArgs { return nil } return fmt.Errorf( - "\"%s\" requires exactly %d argument(s).\n\nUsage: %s\n\n%s", + "\"%s\" requires exactly %d argument(s).\nSee '%s --help'.\n\nUsage: %s\n\n%s", cmd.CommandPath(), number, + cmd.CommandPath(), cmd.UseLine(), cmd.Short, )