fix(test): Suggest -- for libtest arguments#13448
Conversation
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
|
r? @weihanglo rustbot has assigned @weihanglo. Use r? to explicitly pick a reviewer |
weihanglo
left a comment
There was a problem hiding this comment.
Although I don't quite think "pass as a value" is straightforward for people to understand, it does give an example to follow. Thanks for the fix!
|
@bors r+ |
|
☀️ Test successful - checks-actions |
1 similar comment
|
☀️ Test successful - checks-actions |
|
👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request. |
|
Agreed that its not the greatest but its also what we are already displaying in other cases. This just fixes an inconsistency about displaying it. |
Update cargo 11 commits in fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3..9090349adc88e0fcae2644c2cceb830124a10d5d 2024-02-09 15:54:29 +0000 to 2024-02-16 16:56:57 +0000 - chore: Update snapbox (rust-lang/cargo#13441) - chore(deps): update openssl to 3.2.1 again (rust-lang/cargo#13449) - fix(test): Suggest `--` for libtest arguments (rust-lang/cargo#13448) - chore(ci): Drop MSRV:1 patch field (rust-lang/cargo#13442) - fix(add): Remove inconsistent period (rust-lang/cargo#13446) - fix(add): Ensure users know a feature is being created (rust-lang/cargo#13434) - Update tests for changes in latest nightly (rust-lang/cargo#13444) - docs: Minor clarification of build script metadata. (rust-lang/cargo#13436) - Fix old_cargos tests (rust-lang/cargo#13435) - Fix confusing error messages for sparse index replaced source (rust-lang/cargo#13433) - Enable edition migration for 2024 (rust-lang/cargo#13429) r? ghost
Update cargo 11 commits in fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3..9090349adc88e0fcae2644c2cceb830124a10d5d 2024-02-09 15:54:29 +0000 to 2024-02-16 16:56:57 +0000 - chore: Update snapbox (rust-lang/cargo#13441) - chore(deps): update openssl to 3.2.1 again (rust-lang/cargo#13449) - fix(test): Suggest `--` for libtest arguments (rust-lang/cargo#13448) - chore(ci): Drop MSRV:1 patch field (rust-lang/cargo#13442) - fix(add): Remove inconsistent period (rust-lang/cargo#13446) - fix(add): Ensure users know a feature is being created (rust-lang/cargo#13434) - Update tests for changes in latest nightly (rust-lang/cargo#13444) - docs: Minor clarification of build script metadata. (rust-lang/cargo#13436) - Fix old_cargos tests (rust-lang/cargo#13435) - Fix confusing error messages for sparse index replaced source (rust-lang/cargo#13433) - Enable edition migration for 2024 (rust-lang/cargo#13429) r? ghost
Update cargo 12 commits in fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3..7b7af3077bff8d60b7f124189bc9de227d3063a9 2024-02-09 15:54:29 +0000 to 2024-02-17 14:13:00 +0000 - Remove unnecessary `use` statement in metabuild (rust-lang/cargo#13455) - chore: Update snapbox (rust-lang/cargo#13441) - chore(deps): update openssl to 3.2.1 again (rust-lang/cargo#13449) - fix(test): Suggest `--` for libtest arguments (rust-lang/cargo#13448) - chore(ci): Drop MSRV:1 patch field (rust-lang/cargo#13442) - fix(add): Remove inconsistent period (rust-lang/cargo#13446) - fix(add): Ensure users know a feature is being created (rust-lang/cargo#13434) - Update tests for changes in latest nightly (rust-lang/cargo#13444) - docs: Minor clarification of build script metadata. (rust-lang/cargo#13436) - Fix old_cargos tests (rust-lang/cargo#13435) - Fix confusing error messages for sparse index replaced source (rust-lang/cargo#13433) - Enable edition migration for 2024 (rust-lang/cargo#13429)
Update cargo 12 commits in fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3..7b7af3077bff8d60b7f124189bc9de227d3063a9 2024-02-09 15:54:29 +0000 to 2024-02-17 14:13:00 +0000 - Remove unnecessary `use` statement in metabuild (rust-lang/cargo#13455) - chore: Update snapbox (rust-lang/cargo#13441) - chore(deps): update openssl to 3.2.1 again (rust-lang/cargo#13449) - fix(test): Suggest `--` for libtest arguments (rust-lang/cargo#13448) - chore(ci): Drop MSRV:1 patch field (rust-lang/cargo#13442) - fix(add): Remove inconsistent period (rust-lang/cargo#13446) - fix(add): Ensure users know a feature is being created (rust-lang/cargo#13434) - Update tests for changes in latest nightly (rust-lang/cargo#13444) - docs: Minor clarification of build script metadata. (rust-lang/cargo#13436) - Fix old_cargos tests (rust-lang/cargo#13435) - Fix confusing error messages for sparse index replaced source (rust-lang/cargo#13433) - Enable edition migration for 2024 (rust-lang/cargo#13429)
We already do this so long as the argument doesn't look like a
cargo testargument (e.g.--show-output)but
--ignoredlooks like--ignore-rust-versiondo the the suggestion algorithms prefix checks.Before
After
This was fixed in clap-rs/clap#5356 and we just need to update to take advantage of it.
Fixes #12494