invalid global options appearing in task shell completion #11282
Replies: 2 comments
|
Your expectation is correct. This is a completion-spec bug, not a problem with the The source explains both symptoms:
Once the task name has been consumed, hyphen-prefixed words are deliberately task arguments. That is what allows a task to receive its own mise --silent run my:task
# or
mise run --silent my:task
The incorrect part is completion: the generated Practical workarounds until this is fixed:
rm -f "${TMPDIR:-/tmp}"/usage__usage_spec_mise_*.specThe relevant generated Bash completion calls So I would keep the report open as two related completion defects: stale parent-option suggestions after the task positional, and wrong-scope resolution of a task flag that shadows |
|
Thanks for the detailed report — both issues reproduce, and they turned out to be the same root cause. @yhay81's analysis above is spot on, including the part about Status: fixed on both sides. The parser fix is released in usage 3.5.7 (jdx/usage#738), and the mise side (jdx/mise#11284) is merged — it will ship in the next mise release, after 2026.7.13. What was happening. mise builds its completion spec by mounting your tasks into it, via On point 1, one part is intended and won't change: everything after the task name is forwarded to the task, so mise's own flags have to come before it — After the fix, with your task unchanged: $ mise run my:task --<TAB>
--bump --env --output-dir
$ mise run my:task --env <TAB>
dev stage prodSame on One more thing your report shook out: any non-global Upgrading. Both halves are needed: a mise version containing #11284, and This comment was generated by an AI coding assistant. |
Uh oh!
There was an error while loading. Please reload this page.
I have a file based task w/ the following usage comments:
When triggering shell completion for it, I see a number of global options (in addition to the above):
There are two issues:
--env:... but works as expected when I change the option to
--environment:I would expect mise to only offer valid completion options (and not intercept the ones from my task). 🤷
Output from mise doctor:
Note: I installed
mise,bash(v5), andbash-completion@2all from Homebrew.All reactions