The command deno --quiet -- run <my_script> produces the following error:
error: The subcommand 'run' wasn't recognized
Did you mean 'run'?
If you believe you received this message in error, try re-running with 'deno -- run'
USAGE:
deno --quiet
For more information try --help
Version information:
deno 1.2.0
v8 8.5.216
typescript 3.9.2
This seems related to a clap behavior: https://github.com/clap-rs/clap/issues/1744
Notice that it does work with the following syntax:
deno --quiet run -- <my_script>
We need to decide if the format specified in the bug is valid or not, and perhaps improve some documentation, or try to issue a PR to improve clap
Ignoring the parsing details and error reporting of clap, the usage says this is invalid.
USAGE:
deno run [OPTIONS] <SCRIPT_ARG>...
@caspervonb If you're referring to the placement of --quiet, it's a global flag so putting it before the subcommand does work: deno --quiet run mod.ts.
It's apparently intentional that subcommands must come before --, so as @Spoonbender said this is strictly an error message problem tracked in https://github.com/clap-rs/clap/issues/1744.
@caspervonb If you're referring to the placement of --quiet, it's a global flag so putting it before the subcommand does work: deno --quiet run mod.ts.
Was referring to the placement of the subcommand; anything after -- is conventionally positional args given to the invoked command, as is the case here.
So this works as I'd expect based on the usage message, error message from clap could be a bit clearer however.
Most helpful comment
This seems related to a
clapbehavior: https://github.com/clap-rs/clap/issues/1744