We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Multiple features are passed to cargo-metadata as --features foo bar rather than --features foo,bar
--features foo bar
--features foo,bar
To Reproduce
$ cargo new krates-test && cd krates-test $ cargo add [email protected] $ cat <<EOF >src/main.rs use krates::{Builder, Cmd, Krates}; fn main() { let mut cmd = Cmd::new(); cmd.manifest_path("./Cargo.toml"); cmd.features(vec!["foo".to_string(), "bar".to_string()]); let _: Krates = Builder::new().build(cmd, |_| {}).unwrap(); } EOF $ cat <<EOF >>Cargo.toml [features] foo = [] bar = [] EOF $ cargo --quiet run thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Metadata(CargoMetadata { stderr: "error: Found argument 'foo' which wasn't expected, or isn't valid in this context\n\nUSAGE:\n cargo metadata --features <FEATURES>... --format-version <VERSION> --manifest-path <PATH>\n\nFor more information try --help\n" })', src/main.rs:8:55 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Additional context Replacing vec!["foo".to_string(), "bar".to_string()] with vec!["foo,bar".to_string()] causes it to run successfully.
vec!["foo".to_string(), "bar".to_string()]
vec!["foo,bar".to_string()]
I suspect this is due to the following lines - opts.append(&mut cmd.features); should instead be opts.push(cmd.features.join(","));:
opts.append(&mut cmd.features);
opts.push(cmd.features.join(","));
krates/src/builder.rs
Lines 158 to 161 in ad78f9e
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
Multiple features are passed to cargo-metadata as
--features foo bar
rather than--features foo,bar
To Reproduce
Additional context
Replacing
vec!["foo".to_string(), "bar".to_string()]
withvec!["foo,bar".to_string()]
causes it to run successfully.I suspect this is due to the following lines -
opts.append(&mut cmd.features);
should instead beopts.push(cmd.features.join(","));
:krates/src/builder.rs
Lines 158 to 161 in ad78f9e
The text was updated successfully, but these errors were encountered: