From bf562d5cc6df8eaaf92907151e63a54a574724e1 Mon Sep 17 00:00:00 2001 From: Igor Anic Date: Mon, 4 Oct 2021 19:57:23 +0200 Subject: [PATCH] move help to global commands Help is show in each command flags and no-color is in global section. I was thinking whether to move no-color in each command flags or help to global. When help is in global other useful command flags are seems nicely grouped. --- cli/cmd/root.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/cmd/root.go b/cli/cmd/root.go index d9bad463..25e545eb 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -18,6 +18,8 @@ func Execute(ctx context.Context, version string) error { } // no-color is handled in cli/log pacakge cmd.PersistentFlags().Bool("no-color", false, "don't use colors in output") + cmd.PersistentFlags().Bool("help", false, "show command help") // move help to global commands + cmd.Flags().Bool("version", false, "show mantil version") // remove -v shortcut for version add := func(factory func() *cobra.Command) { sub := factory()