Unable to pass --verbose flag to mise task via usage
- Dominant language
- Rust
- Stars
- 1k
- Forks
- 59
- Avg merge
- 5h 58m
- Merged PRs (30d)
- 362
Description
Hey there 👋 !
I've recently added a `--verbose` option to one of my mise tasks, alongside a bunch of other `#USAGE` flags and arguments. Everything works as expected, other than the `--verbose` flag.
What I've observed is that, if the `--verbose` flag is the first parameter, it seems to be grabbed by mise and not passed to the task.
This can be replicated with a minimal task like:
``` Bash
#!/usr/bin/env bash
#MISE description="Sample task."
#USAGE flag "--verbose" help="Output extra debug logging."
#USAGE flag "--other-flag" help="Random extra test flag."
#USAGE flag "--force" help="Ignore caches."
if [ "$usage_verbose" = "true" ] ; then
echo "Verbose"
else
echo "Not verbose"
fi
if [ "$usage_force" = "true" ] ; then
echo "Force"
else
echo "Do not force"
fi
```
Running `mise run sample-task --verbose` results in the unexpected output:
```
Not verbose
Do not force
```
Running `mise run sample-task --other-flag --verbose` results in the expected output:
```
Verbose
Do not force
```
Is there anything I need to change in my usage config, or should I be running tasks in a different way? This issue looks similar to https://github.com/jdx/usage/issues/162, but the solution suggested on that ticket just appears to open the interactive task selector for me.
Any guidance is appreciated 🙇♂.
Contributor guide
Assessment
This issue has not been assessed yet.