Help groups for commands and options #1908
Closed
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.
Problem
Some people with larger programs would like to break up their commands and options into groups in the help. There have not been a lot of requests for this, but it is something I had noticed as a possible enhancement.
See: #374 (comment) #1897
Help groups are common in "big" programs, but big programs often have custom help systems anyway! (e.g. git, npm)
Solution
I am currently trying to implement some of the API ideas in #1897 to see how they go. If I can't decide which one or ones are best, I might open a poll for feedback on preferred approach.
Two caveats from work so far:
ChangeLog
Still a work in progress, I am coding to try ideas so anything could change. 🛠
What is working currently. Can mix and match.
Map, which implies order of groups displayed, and order of commands and options displayed. Help option and help command are included without special code. Options allow short or long option (or attribute name).
Group specified on command and option. This is nice for setting up everything about a command or option in one place. Small downsides are group specified multiple times and have to build Option.