Repository navigation
mise run <task> -h shows help even when the task's usage spec disables help and declares its own -h
#15532
Unanswered
powerman
asked this question in
Troubleshooting and bug reports
Replies: 1 comment
|
Thanks for the detailed report and the pointer to mise scans the task's args for The AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.317. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When a task's
usagedisables the built-in help (disable_help #trueordisable_help_flag #true) and declares its own-hflag,mise run <task> -h <value>still prints the task's help and exits 0, so the task does not run.There is no way to pass that flag: after
--(#9118) or withraw_args = true, mise skips usage parsing entirely, so$usage_hoststays empty.Found while building kongusage (a Kong → usage spec exporter), which emits
disable_help #trueand declares the help flag the way the Kong CLI does; a CLI withkong.NoDefaultHelp()may use-hfor something else.Reproduce
The same happens with
disable_help_flag #trueinstead ofdisable_help #true,and with
-has the value of a flag withallow_hyphen_values:Expected
-h/--helpare task help requests only where usage-lib's parser takes them as such (is_help_arginlib/src/parse.rs): not when the spec disables help, not when a declared flag owns the word, and not as a flag's value.So
mise run dh -h xprintshost=xandmise run hv --pat -hprintspat=-h.Tasks which do not opt out keep the current behaviour (#7893).
Where
src/cli/run.rs:1019(has_help_in_task_args) looks for-h/--helpanywhere in the task's arguments without consulting the spec, and the early help path then renders help instead of parsing.Related: #10799 changed the same path to pick the subcommand from the arguments.
The
usage bash/zsh/fishwrapper of the usage CLI has the same early scan (cli/src/cli/shell.rs), sousage bash script.sh -h xwith the same#USAGElines behaves the same; usage-lib's parser itself handles it.mise 2026.10.25, 2026.11.5 and
main(593a7f5), Linux.AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: 2.1.316.
All reactions