Skip to content

feat(parse): support custom help and version actions - #1123

Merged
jdx merged 5 commits into
agent/subcommand-help-groupsfrom
agent/builtin-entry-control
Aug 21, 2026
Merged

feat(parse): support custom help and version actions#1123
jdx merged 5 commits into
agent/subcommand-help-groupsfrom
agent/builtin-entry-control

Conversation

@jdx

@jdx jdx commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Stack created with GitHub Stacks CLIGive Feedback 💬


Note

Medium Risk
Touches core parse, help rendering, and completion walking in both Rust and Go, so regressions would change how help/version is requested. Behavior is additive and gated by explicit flags/actions.

Overview
CLIs can now disable the synthesized --help/-h, help subcommand, and --version/-V entries, and relocate those behaviors onto declared flags via Help, HelpShort, HelpLong, and Version actions.

The same properties travel through typed Rust, KDL, usage-lib, generated Go, and the clap bridge. Help pages omit the synthetic rows when disabled; custom flags keep their own help text. Completion walking no longer treats a declared help/version action as a help-topic parse, so later words still complete.

Disabling these built-ins is no longer a clap-bridge fidelity loss. Derive fields with a non-binding action must be bool flags.

Reviewed by Cursor Bugbot for commit 238871f. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 71bc401d-44e3-4fcc-8e81-757e372e99ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jdx jdx changed the title agent/builtin entry control feat(parse): support custom help and version actions Aug 20, 2026
Comment thread lib/src/parse.rs
@jdx
jdx force-pushed the agent/builtin-entry-control branch from 792f352 to c068f02 Compare August 20, 2026 12:01
@jdx
jdx force-pushed the agent/builtin-entry-control branch from c068f02 to 3189067 Compare August 20, 2026 12:04
@jdx
jdx force-pushed the agent/builtin-entry-control branch from 3189067 to ceb9956 Compare August 20, 2026 12:22
Comment thread argv/src/lib.rs
@jdx
jdx force-pushed the agent/builtin-entry-control branch from a966d16 to 23c2cb5 Compare August 20, 2026 12:36
Comment thread argv/src/complete.rs Outdated
@jdx
jdx force-pushed the agent/builtin-entry-control branch from d713555 to 2c7bf90 Compare August 20, 2026 12:55
Comment thread go/argv/parser.go
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
markdown █▁▁▃ 199,315,003 → 201,208,261 +0.95% 19.00 → 19.18ms +0.95%
startup ▁▅▅█ 1,221,718 → 1,225,360 +0.30% 1.35 → 1.33ms -1.06%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

Shadow comparison

Parsing mise use -g node@20 against a shadow of mise's committed spec.
Reported, not gated: the shadow grows as the derive learns to express more, so
what to watch is the ratio rather than either column.

framework instructions, cold parse vs usage
usage 4353
argh 6292 1.4x
clap 5893640 1353x
bpaf 21917948 5035x
                                              min       p01       p10    median
usage-rs: argv -> struct                      185       192       193       196  ns
argh: argv -> struct                          299       304       320       338  ns
clap: build tree + parse -> struct         482525    483947    486870    493922  ns
bpaf: build parser + parse -> struct      1623497   1623497   1628202   1637880  ns

usage: argv -> struct                             207 ns      0.21 µs
clap: build tree + parse -> struct             497163 ns    497.16 µs
clap: parse -> struct, tree reused              22947 ns     22.95 µs
clap: build tree only                          306010 ns    306.01 µs

238871fba379 vs c10d85cbe1b9 · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the agent/builtin-entry-control branch from e449097 to 1022515 Compare August 20, 2026 13:06
Comment thread lib/src/parse.rs
@jdx
jdx force-pushed the agent/builtin-entry-control branch from 1022515 to a742df6 Compare August 20, 2026 13:28
@jdx
jdx force-pushed the agent/builtin-entry-control branch from a742df6 to 3c7e217 Compare August 21, 2026 01:50
Comment thread derive/src/codegen.rs
@jdx
jdx force-pushed the agent/builtin-entry-control branch 2 times, most recently from 4b1a6f3 to b9c5e5e Compare August 21, 2026 03:19

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4b1a6f3. Configure here.

Comment thread lib/src/parse.rs
@jdx
jdx force-pushed the agent/builtin-entry-control branch from b9c5e5e to 7cf0ea4 Compare August 21, 2026 03:20
@jdx
jdx force-pushed the agent/builtin-entry-control branch 3 times, most recently from 0c04ae1 to 12abcc0 Compare August 21, 2026 03:49
@jdx
jdx merged commit 0992682 into main Aug 21, 2026
10 checks passed
@jdx
jdx deleted the agent/builtin-entry-control branch August 21, 2026 09:18
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