-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
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
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 test
argument (e.g.--show-output
)but
--ignored
looks like--ignore-rust-version
do 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