Forward --help/--version to task in run alias#54
Conversation
`run <task> --help` (and -h/-V/--version) now reach the task's own help/version instead of printing the `run` alias's, removing the need for `run <task> -- --help`. Bare `run --help`/`--version`, including after global flags (`run --pm npm --help`), still print the alias's own help/version, and `run <task> -- --help` still forwards literally. clap's built-in help/version flags short-circuit parsing wherever they appear, so they are disabled on RunAliasCli and left undefined. An undefined hyphen token after the first positional is swallowed by `args` (trailing_var_arg) and forwarded; a leading one can't fill the hyphen-rejecting `task` positional and surfaces as UnknownArgument, which run_alias_in_dir classifies as the alias's own help/version request. Since -h/--help/-V/--version are no longer clap args, they are documented in the help footer (after_help) rather than the options list. The `runner run` subcommand is intentionally unchanged.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
runner | 9213583 | Commit Preview URL Branch Preview URL |
Jun 14 2026, 09:49 AM |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
🚫 Excluded labels (none allowed) (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 7 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (7 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
9213583 to
7d511ff
Compare
Summary
The
runalias now intelligently forwards--helpand--versionflags to the task when they follow a task name, while still printing the binary's own help/version when these flags appear before any task.Changes
Disabled clap's built-in help/version flags on
RunAliasClito prevent them from short-circuiting parsing. This allows trailing help/version flags to be captured by theargsfield and forwarded to the task instead.Added builtin request detection via new
alias_builtin_request()function that classifies parse errors as help/version requests. When a help/version flag appears before any task, it cannot fill the hyphen-rejectingtaskpositional and surfaces as anUnknownArgumenterror, which is now recognized as a request for the binary's own help/version.Implemented help/version handling in
run_alias_in_dir()that:print_run_alias_help()function for help requestsUpdated help text to document the new behavior: help/version flags before a task print the binary's own help/version, while those after a task are forwarded. The
--separator can force literal forwarding.Behavior
run --help→ printsrunalias helprun --pm npm --help→ printsrunalias help (flag before task)run <task> --help→ forwards to task (flag after task)run <task> -- --help→ forwards literally (after separator)run <task> -h→ forwards to task (short form)The
runner runsubcommand behavior is unchanged.