Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #32 +/- ##
==========================================
- Coverage 64.84% 64.36% -0.49%
==========================================
Files 4 4
Lines 532 550 +18
==========================================
+ Hits 345 354 +9
- Misses 129 138 +9
Partials 58 58
Continue to review full report at Codecov.
|
0f38acf to
3a2c5a2
Compare
Cobra allows for aliases to be defined for a command, but only allows these to be defined at the same level (for example, `docker image ls` as alias for `docker image list`). Our CLI has some commands that are available both as a top-level shorthand as well as `docker <object> <verb>` subcommands. For example, `docker ps` is a shorthand for `docker container ps` / `docker container ls`. This patch introduces a custom "aliases" annotation that can be used to print all available aliases for a command. While this requires these aliases to be defined manually, in practice the list of aliases rarely changes, so maintenance should be minimal. As a convention, we could consider the first command in this list to be the canonical command, so that we can use this information to add redirects in our documentation in future. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
3a2c5a2 to
15a6d25
Compare
Member
Author
|
Moved this one out of draft |
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 free
to 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.
Cobra allows for aliases to be defined for a command, but only allows these
to be defined at the same level (for example,
docker image lsas alias fordocker image list). Our CLI has some commands that are available both as atop-level shorthand as well as
docker <object> <verb>subcommands. For example,docker psis a shorthand fordocker container ps/docker container ls.This patch introduces a custom "aliases" annotation that can be used to print
all available aliases for a command. While this requires these aliases to be
defined manually, in practice the list of aliases rarely changes, so maintenance
should be minimal.
As a convention, we could consider the first command in this list to be the
canonical command, so that we can use this information to add redirects in
our documentation in future.