--color=always causes issues on Linux when trying to pass through arguments using Cargo
See original GitHub issueThere appears to be an issue trying to use Cargo’s pass through arguments.
Under Additional Arguments
under a run configuration, to pass CLI arguments to the binary you are trying to run, you need to separate Cargo’s parameters from your binary’s parameters with --
(two dash’s).
However it seems that --color=always
on Linux is dynamically added to the end of the list of arguments passed to Cargo. This means that in this case, the argument is instead passed to the binary instead of Cargo.
Given Additional Arguments
: --bin numfmt -- --help
Output:
/home/<user>/.cargo/bin/cargo run --bin numfmt -- --help --color=always
Finished debug [unoptimized + debuginfo] target(s) in 0.2 secs
Running `target/debug/numfmt --help --color=always`
numfmt: error: Unrecognized option: 'color'.
Process finished with exit code 1
Added here: https://github.com/intellij-rust/intellij-rust/pull/801/files#diff-5420463ef1508e0dd1db9c82ad7a823eR86
Looks like it could be fixed by just prepending instead of appending, or looking for the existence of --
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Fixed by https://github.com/intellij-rust/intellij-rust/pull/828.
Should be in nightly today and in alpha tomorrow!
@juszczakn: have you come around to adding a test, or should it be picked up by someone else?