Dont sort flags by default

This commit is contained in:
Kovid Goyal 2022-08-16 16:10:36 +05:30
parent 1b8805bc6f
commit 393820e77a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -222,6 +222,8 @@ func prettify(text string) string {
val = val[idx:]
}
return bold_fmt(val)
case "opt":
return bold_fmt(val)
case "yellow":
return yellow_fmt(val)
case "blue":
@ -348,6 +350,8 @@ func CreateCommand(cmd *cobra.Command) *cobra.Command {
if cmd.Run == nil {
cmd.Run = SubCommandRequired
}
cmd.PersistentFlags().SortFlags = false
cmd.Flags().SortFlags = false
return cmd
}