Repository navigation
Closed
Conversation
Add cmdutil.ApplyCuratedShort which accepts a command, a resource name (e.g: `Pull Requests`) and a list of subcommand names which are then used to generate a human friendly list of subcommands supported for the `Short` description of the command. Closes #1777
This comment has been minimized.
This comment has been minimized.
samcoe
reviewed
Sep 25, 2020
samcoe
left a comment
Contributor
There was a problem hiding this comment.
Thanks for taking on this work 🙇
Code wise this looks really good to me. I like the thorough tests!
Contributor
|
Thanks for this work! It was valuable research and after a lot of internal discussion we've agreed that while these subcommand docs (and our first use experience in general) could use improvement, this isn't the direction we'd like to go in. It's overly mechanical and, when we start looking into internationalization, would be difficult to translate. |
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.
Adds
cmdutil.ApplyCuratedShortwhich accepts a command, a resource name (e.g:Pull Requests) and a list of subcommand names which are then used to generate a human friendly list of subcommands supported for theShortdescription of the command.Note: this is a speculative example to be reviewed by @ampinsk -- in response to their comment on #1777. The PR is ready to go but marked as Draft so it isn't merged before @ampinsk has decided if this is the right direction :-)
ApplyCuratedShortis explicitly added to a command after the subcommands have been registered, e.g:Some additional examples (as captured in the test cases):
1 command, all curated:
pr: list Pull Requests2 commands, all curated:
pr: list and view Pull Requests3 commands, all curated:
pr: list, view and create Pull Requests4 commands, 3 curated:
pr: list, view and create Pull Requests (+1 more)5 commands, 3 curated:
pr: list, view and create Pull Requests (+2 more)2 commands, 2 curated,
Listcapitalised:pr: List and view Pull RequestsI added the curated list to each of the core commands, choosing the subcommands that best represent the breadth of functionality supported for that resource.
Also, if this PR does make it into consideration, worth noting that this is my first real world contribution in Go so I'd recommend a close review 🔎
Thanks!