Skip to content

Commit

Permalink
move help to global commands
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ianic committed Oct 4, 2021
1 parent f29e353 commit bf562d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit bf562d5

Please sign in to comment.