-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: print full command as aliases in usage output
The default output for Cobra aliases only shows the subcommand as alias, which is not very intuitive. This patch changes the output to print the full command as it would be called by the user. Note that there's still some improvements to be made; due to how aliases must be set-up in Cobra, aliases at different "levels" are still not shown. So for example, `docker ps --help` will not show `docker container ps` as alias, and vice-versa. This will require additional changes, and can possibly be resolved using custom metadata/annotations. Before this patch: docker container ls --help Usage: docker container ls [OPTIONS] List containers Aliases: ls, ps, list After this patch: docker container ls --help Usage: docker container ls [OPTIONS] List containers Aliases: docker container ls, docker container ps, docker container list Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Loading branch information
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters