From 53ee1418af1d82c943daa88a7d8edd1d48e366f6 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Mon, 14 Dec 2020 17:40:51 +0100 Subject: [PATCH] Do not change root flags for all commands Signed-off-by: Guillaume Tardif --- cli/main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/main.go b/cli/main.go index a0883f22f..026af7b9f 100644 --- a/cli/main.go +++ b/cli/main.go @@ -150,8 +150,7 @@ func main() { opts.AddContextFlags(root.PersistentFlags()) opts.AddConfigFlags(root.PersistentFlags()) root.Flags().BoolVarP(&opts.Version, "version", "v", false, "Print version information and quit") - root.PersistentFlags().SetInterspersed(false) - root.Flags().SetInterspersed(false) + walk(root, func(c *cobra.Command) { c.Flags().BoolP("help", "h", false, "Help for "+c.Name()) })