running watchexec --restart "cargo run" directly in cmd.exe works
[package.metadata.commands]
dev = 'watchexec --restart "cargo run"'
but when I run (in cmd.exe)
cargo cmd dev
I get:
> watchexec --restart "cargo run"
'\"cargo run\"' is not recognized as an internal or external command,
operable program or batch file.
my understanding is that " became \"
since it gives the exact output if I run \"cargo run\" in cmd.exe
or
"cargo run" was passed to watchexec instead of cargo run (without quotes)
using this:
dev = 'watchexec --restart "cargo --quiet run"'
I get:
> watchexec --restart "cargo --quiet run""
error: Found argument '--quiet' which wasn't expected, or isn't valid in this context
USAGE:
watchexec <command>... --restart
For more information try --help
why doesn't double quotes work ? which shell is used to execute commands?
my current workaround:
[package.metadata.commands]
quietRun = 'cargo --quiet run'
dev = 'watchexec --restart cargo cmd quietRun'
cargo cmd dev works but it prints
> cargo --quiet run
every time I edit or save files
can you provide a way to make specific commands quiet? (not print for example > cargo --quiet run)
make anything that starts with quiet_ be quiet, so
this be quiet: quiet_quietRun = 'cargo --quiet run'
this not be quiet: quietRun = 'cargo --quiet run'
but this will be slower since cargo cmd quietRun will be run every time. instead of directly cargo --quiet run
running
watchexec --restart "cargo run"directly in cmd.exe worksbut when I run (in cmd.exe)
cargo cmd devI get:
my understanding is that
"became\"since it gives the exact output if I run
\"cargo run\"in cmd.exeor
"cargo run"was passed to watchexec instead ofcargo run(without quotes)using this:
dev = 'watchexec --restart "cargo --quiet run"'I get:
why doesn't double quotes work ? which shell is used to execute commands?
my current workaround:
cargo cmd devworks but it prints> cargo --quiet runevery time I edit or save files
can you provide a way to make specific commands quiet? (not print for example
> cargo --quiet run)make anything that starts with
quiet_be quiet, sothis be quiet:
quiet_quietRun = 'cargo --quiet run'this not be quiet:
quietRun = 'cargo --quiet run'but this will be slower since
cargo cmd quietRunwill be run every time. instead of directlycargo --quiet run