Skip to content

0.0.7: subcommands in groups and in one order for help, snapshot and messages; a help epilogue - #15

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/help-groups
Dec 2, 2026
Merged

Sunrisepeak merged 1 commit into
mainfrom
feat/help-groups

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

A help can list its subcommands in groups and by name, and say what comes after the list; help, snapshot and 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.
  • One listing serves print_help, snapshot(app) and the message a subcommand is required: a tool's help, its completions and its messages agree. A hidden command is no longer named by that message.
  • Nothing opted in: the help is byte-identical to 0.0.6, and no parse changes — the first declared subcommand still wins a name. One difference by design: the snapshot now leads with the completion command, where 0.0.6 appended it after the help had shown it first.

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 test on 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.

…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
Sunrisepeak merged commit e7760f4 into main Dec 2, 2026
1 check passed
@Sunrisepeak
Sunrisepeak deleted the feat/help-groups branch December 2, 2026 21:50
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant