Skip to content

Commit 8530c1a

Browse files
authoredNov 15, 2024
feat: support hyphen values for --build-jobs (#1874)
cargo --jobs supports negative values: rust-lang/cargo#9217 currently this fails: ``` cargo nextest run --build-jobs -1 error: unexpected argument '-1' found tip: to pass '-1' as a value, use '-- -1' ``` because clap doesn't support this by default and requires `allow_hyphen_values = true` clap-rs/clap#1245
1 parent 8668970 commit 8530c1a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

Diff for: ‎cargo-nextest/src/cargo_cli.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ pub(crate) struct CargoOptions {
9898
long,
9999
value_name = "N",
100100
group = "cargo-opts",
101-
help_heading = "Compilation options"
101+
help_heading = "Compilation options",
102+
allow_hyphen_values = true
102103
)]
103104
build_jobs: Option<String>,
104105

Diff for: ‎cargo-nextest/src/dispatch.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2406,6 +2406,9 @@ mod tests {
24062406
// Test negative test threads
24072407
"cargo nextest run --jobs -3",
24082408
"cargo nextest run --jobs 3",
2409+
// Test negative cargo build jobs
2410+
"cargo nextest run --build-jobs -1",
2411+
"cargo nextest run --build-jobs 1",
24092412
];
24102413

24112414
let invalid: &[(&'static str, ErrorKind)] = &[

0 commit comments

Comments
 (0)