Repository navigation
0.0.7: subcommands in groups and in one order for help, snapshot and messages; a help epilogue - #15
Merged
Merged
Conversation
…messages; a help epilogue
- `App::group(s)` on a subcommand: the heading its parent's help lists it under. A group takes the place of the first command that declares it; the commands without one follow the groups.
- `App::help_options({ .order = alphabetical, .ungrouped = "..." })`: by name inside a group and among the rest, and a heading for the rest. Declared order stays the default.
- `App::help_epilogue(s)`: printed after the subcommands (the lines to copy, where to read on).
- `CompletionOptions::group`: the completion command's heading, without giving that group its place.
- One listing serves `print_help`, `snapshot(app)` and the 'a subcommand is required' message. A hidden command is no longer named by that message, and the snapshot now leads with the completion command where 0.0.6 appended it.
- Nothing opted in: the help is byte-identical to 0.0.6, and no parse changes: the first declared subcommand still wins a name.
- Tests: eight cases in `tests/cmdline_test.cpp` (the default output, groups and by name, declared inside a group, the snapshot's order, the completion command leading, the epilogue, the message, the parse untouched); 59 + 12 pass on mcpp 2026.11.8.1.
- `docs/api.md` states the rules of the listing with an example; README names the feature; version 0.0.7.
Sunrisepeak
added a commit
to mcpplibs/mcpp-index
that referenced
this pull request
Dec 2, 2026
…lp, snapshot and messages; a help epilogue (#974) mcpplibs.cmdline 0.0.7 (mcpplibs/cmdline#15): a help can list its subcommands in groups and by name, and say what comes after the list. One listing serves `print_help`, `snapshot(app)` and the message that a subcommand is required. Nothing opted in, the help is byte-identical to 0.0.6.
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.
A help can list its subcommands in groups and by name, and say what comes after the list; help,
snapshotand the message of a missing subcommand then read one listing.Change
App::group(s)on a subcommand: the heading its parent's help lists it under. A group takes the place of the first command that declares it; the commands without a group follow the groups.App::help_options({ .order = alphabetical, .ungrouped = "..." }): by name inside a group and among the rest, and a heading for the rest. Declared order stays the default.App::help_epilogue(s): printed after the subcommands — the lines to copy, where to read on.CompletionOptions::group: the completion command's heading, without giving that group its place.print_help,snapshot(app)and the messagea subcommand is required: a tool's help, its completions and its messages agree. A hidden command is no longer named by that message.Tests
tests/cmdline_test.cpp, eight cases: the default output; groups by first declaration and by name inside; declared order inside a group with no heading for the rest; the snapshot in the same order; the completion command leading the snapshot; the epilogue; the message of a missing subcommand (hidden commands left out); the listing leaving the parse alone.mcpp build+mcpp teston mcpp 2026.11.8.1: 59 + 12 pass.Documents
docs/api.md(the rules of the listing, an example), README (the feature), version 0.0.7.