Skip to content

Commit

Permalink
fix(test): Suggest -- for libtest arguments
Browse files Browse the repository at this point in the history
We already do this so long as the argument doesn't look like a
`cargo test` argument (e.g. `--show-output`)
but `--ignored` looks like `--ignore-rust-version` do the the suggestion
algorithms prefix checks.

Before
```
error: unexpected argument '--ignored' found

  tip: a similar argument exists: '--ignore-rust-version'

Usage: cargo test --ignore-rust-version [TESTNAME] [-- [ARGS]...]

For more information, try '--help'.
```
After
```
error: unexpected argument '--ignored' found

  tip: a similar argument exists: '--ignore-rust-version'
  tip: to pass '--ignored' as a value, use '-- --ignored'

Usage: cargo test --ignore-rust-version [TESTNAME] [-- [ARGS]...]

For more information, try '--help'.
```

Fixes rust-lang#12494
  • Loading branch information
epage authored and stupendoussuperpowers committed Feb 28, 2024
1 parent 07df63c commit ee3f403
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cargo-test-support = { path = "crates/cargo-test-support" }
cargo-util = { version = "0.2.6", path = "crates/cargo-util" }
cargo-util-schemas = { version = "0.2.0", path = "crates/cargo-util-schemas" }
cargo_metadata = "0.18.1"
clap = "4.4.18"
clap = "4.5.1"
color-print = "0.3.5"
core-foundation = { version = "0.9.4", features = ["mac_os_10_7_support"] }
crates-io = { version = "0.40.0", path = "crates/crates-io" }
Expand Down

0 comments on commit ee3f403

Please sign in to comment.