Dont sort flags by default

This commit is contained in:
Kovid Goyal
2022-08-16 16:10:36 +05:30
parent 1b8805bc6f
commit 393820e77a

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
}