Skip to content

Commit

Permalink
Merge pull request #150 from PhilippMolitor/feature/cargo-config
Browse files Browse the repository at this point in the history
add cargo `--config` arg
  • Loading branch information
burrbull authored Oct 16, 2024
2 parents 0f4111a + 2d1c4a4 commit a0fb1c5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ To see all the flags the proxied tool accepts run `cargo-{} -- --help`.{}",
.long("target")
.value_name("TRIPLE")
.help("Target triple for which the code is compiled"),
Arg::new("config")
.long("config")
.value_name("CONFIG")
.help("Override a configuration value"),
Arg::new("color")
.long("color")
.action(ArgAction::Set)
Expand Down Expand Up @@ -459,6 +463,12 @@ fn cargo_build_args<'a>(matches: &'a ArgMatches, cargo: &mut Command) -> (BuildT
cargo.arg(package);
}

if let Some(config) = matches.get_many::<String>("config") {
for c in config {
cargo.args(["--config", c]);
}
}

if let Some(jobs) = matches.get_one::<String>("jobs") {
cargo.arg("-j");
cargo.arg(jobs);
Expand Down

0 comments on commit a0fb1c5

Please sign in to comment.