Uh oh!
There was an error while loading. Please reload this page.
cli: print full command as aliases in usage output - #3693
Merged
Conversation
thaJeztahforce-pushed
the
cli_usage_aliases
branch
from
June 28, 2022 08:27
c41824f to
4dead11CompareCodecov Report
@@ Coverage Diff @@## master #3693 +/- ##
=======================================
Coverage 59.01% 59.02% =======================================
Files 289 289 Lines 24623 24645 +22 =======================================
+ Hits 14532 14546 +14 - Misses 9218 9225 +7 - Partials 873 874 +1 |
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>
thaJeztahforce-pushed
the
cli_usage_aliases
branch
from
June 28, 2022 09:03
4dead11 to
2d88c89ComparethaJeztah
marked this pull request as ready for review
June 28, 2022 09:22
thaJeztah
commented
Jun 28, 2022
MemberAuthor
(follow-up is in #3694, but also want to make some changes to our YAML generator) |
rumpl
approved these changes
Jun 28, 2022
This file contains hidden or 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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 --helpwill not showdocker container psas alias, and vice-versa.This will require additional changes, and can possibly be resolved using custom
metadata/annotations.
Before this patch:
After this patch:
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)