From 044e7f571d4b132e9c069af7c70c84a1ee9c1fa7 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Wed, 30 Sep 2020 11:25:08 +0200 Subject: [PATCH] Remove go template from help on list commands Signed-off-by: Ulysses Souza --- cli/cmd/context/ls.go | 4 ++-- cli/cmd/ps.go | 2 +- cli/cmd/version.go | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cli/cmd/context/ls.go b/cli/cmd/context/ls.go index 5b33a9272..1e0ee1116 100644 --- a/cli/cmd/context/ls.go +++ b/cli/cmd/context/ls.go @@ -58,7 +58,7 @@ func listCommand() *cobra.Command { } cmd.Flags().BoolVarP(&opts.quiet, "quiet", "q", false, "Only show context names") cmd.Flags().BoolVar(&opts.json, "json", false, "Format output as JSON") - cmd.Flags().StringVar(&opts.format, "format", "", "Format the output. Values: [pretty | json | go template]. (Default: pretty)") + cmd.Flags().StringVar(&opts.format, "format", "", "Format the output. Values: [pretty | json]. (Default: pretty)") _ = cmd.Flags().MarkHidden("json") return cmd @@ -104,7 +104,7 @@ func runList(cmd *cobra.Command, opts lsOpts) error { if c.Name == currentContext { contextName += " *" } - fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\n", + _, _ = fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\n", contextName, c.Type(), c.Metadata.Description, diff --git a/cli/cmd/ps.go b/cli/cmd/ps.go index f3eee0d16..ff1c43f1f 100644 --- a/cli/cmd/ps.go +++ b/cli/cmd/ps.go @@ -53,7 +53,7 @@ func PsCommand() *cobra.Command { cmd.Flags().BoolVarP(&opts.quiet, "quiet", "q", false, "Only display IDs") cmd.Flags().BoolVarP(&opts.all, "all", "a", false, "Show all containers (default shows just running)") cmd.Flags().BoolVar(&opts.json, "json", false, "Format output as JSON") - cmd.Flags().StringVar(&opts.format, "format", "", "Format the output. Values: [pretty | json | go template]. (Default: pretty)") + cmd.Flags().StringVar(&opts.format, "format", "", "Format the output. Values: [pretty | json]. (Default: pretty)") _ = cmd.Flags().MarkHidden("json") return cmd diff --git a/cli/cmd/version.go b/cli/cmd/version.go index bdefec3dc..0353dcdff 100644 --- a/cli/cmd/version.go +++ b/cli/cmd/version.go @@ -42,8 +42,7 @@ func VersionCommand(version string) *cobra.Command { } // define flags for backward compatibility with com.docker.cli flags := cmd.Flags() - flags.StringP(formatOpt, "f", "", "Format the output using the given Go template") - // flags.String(&opts.format, "format", "", "Format the output. Values: [pretty | json | go template]. (Default: pretty)") + flags.StringP(formatOpt, "f", "", "Format the output. Values: [pretty | json]. (Default: pretty)") flags.String("kubeconfig", "", "Kubernetes config file") mobyflags.AddMobyFlagsForRetrocompatibility(flags)