Repository navigation
feat: enhance help system with -h/--help distinction, help command, and grouping - #2
Merged
Merged
Conversation
…nd grouping - Add -h for brief help (Usage + Commands only) - Add --help for detailed help (all sections) - Add built-in help [command] subcommand - Add group property for options and arguments - Add groupOrder configuration for HelpConfig - Add groupTitle style for styled output - Update tests and demo with new features
JakiChen
marked this pull request as ready for review
May 23, 2026 13:15
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.
Summary
Enhance the help system in clippy CLI framework with the following features:
Changes
Distinguish
-hand--helpbehavior:-hshows brief help (Usage + Commands only)--helpshows detailed help (all sections including Options)Built-in
helpsubcommand:help→ displays detailed help for current commandhelp <subcommand>→ displays help for specified subcommandGrouping support for options and arguments:
groupproperty toOptionDefandArgDeftypesgroupOrdertoHelpConfigfor ordering groupsgroupTitlestyle for styled outputFiles Changed
src/types.ts- Addedgroup?: stringto OptionDef and ArgDefsrc/help.ts- Enhanced HelpConfig with groupOrder, showAllOnBrief, groupTitle stylesrc/command.ts- Added -h/--help distinction and help command handlingtests/command.test.ts- Added tests for new help featuresexamples/demo.ts- Updated demo with grouped options exampleTesting
demo -h→ brief helpdemo --help→ detailed helpdemo help→ detailed helpdemo help serve→ serve subcommand helpdemo serve -h→ brief help for subcommand@JakiChen can click here to continue refining the PR