move commonly used top-level commands to the top of --help
This adds a new annotation to commands that are known to be frequently used, and allows setting a custom weight/order for these commands to influence in what order they appear in the --help output. I'm not entirely happy with the implementation (we could at least use some helpers for this, and/or make it more generic to group commands in output), but it could be a start. For now, limiting this to only be used for the top-level --help, but we can expand this to subcommands as well if we think it makes sense to highlight "common" / "commonly used" commands. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -52,6 +52,9 @@ func NewExecCommand(dockerCli command.Cli) *cobra.Command {
|
||||
options.Command = args[1:]
|
||||
return RunExec(dockerCli, options)
|
||||
},
|
||||
Annotations: map[string]string{
|
||||
"category-top": "2",
|
||||
},
|
||||
}
|
||||
|
||||
flags := cmd.Flags()
|
||||
|
||||
Reference in New Issue
Block a user