iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
👀

How to specify the --target flag in cargo-watch

に公開

Article creation date: 2019/09/21

cargo-watch is a convenient tool that allows you to monitor commands using the -x option.

$ cargo watch -x check

However, passing options like --target here results in an error.

$ cargo check --target arm-unknown-linux-musleabihf
error: Found argument '--target' which wasn't expected, or isn't valid in this context

USAGE:
    cargo watch [FLAGS] [OPTIONS]

For more information try --help

Solution

Although an issue is currently open, you can work around this for now by using -s instead of -x.

https://github.com/passcod/cargo-watch/issues/97

$ cargo watch -s "cargo check --target arm-unknown-linux-musleabihf"

Discussion