-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 --quiet being used with nested subcommands. #12959
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @weihanglo (rustbot has picked a reviewer for you, use r? to override) |
rustbot
added
A-cli
Area: Command-line interface, option parsing, etc.
Command-add
Command-bench
Command-build
Command-check
Command-clean
Command-doc
Command-fetch
Command-fix
Command-generate-lockfile
Command-init
Command-install
Command-locate-project
Command-login
Command-logout
Command-metadata
Command-new
Command-owner
Command-package
Command-pkgid
Command-publish
Command-read-manifest
Command-remove
Command-run
Command-rustc
Command-rustdoc
Command-search
Command-tree
labels
Nov 12, 2023
rustbot
added
Command-uninstall
Command-update
Command-vendor
Command-verify-project
Command-version
Command-yank
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Nov 12, 2023
epage
approved these changes
Nov 12, 2023
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.
Feel free to r= me when its ready
This fixes an issue where `--quiet` doesn't work with commands that have subcommands. This is because `config_configure` only looks at the global and top-level subcommand, and not deeper subcommands. The issue was that `--quiet` was not defined as a global flag. This was changed in rust-lang#6358 in order to give a better help message for `cargo test --quiet`. I don't remember if clap just didn't support overriding at the time, or if we just didn't know how it worked. Anyways, it seems to work to override it now, so I think it should be fine to mark it as global. This should bring in `--quiet` more in-line with how `--verbose` works. This means that `--quiet` is now accepted with `cargo report`, `cargo help`, and `cargo config`. This also fixes `--quiet` with `cargo clean gc`. This should also help with supporting `--quiet` with the new `cargo owner` subcommands being added in rust-lang#11879. Fixes rust-lang#12957
rustbot
added
the
A-infrastructure
Area: infrastructure around the cargo repo, ci, releases, etc.
label
Nov 12, 2023
@bors r=epage |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Nov 12, 2023
☀️ Test successful - checks-actions |
This was referenced Nov 12, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 15, 2023
Update cargo 15 commits in 6790a5127895debec95c24aefaeb18e059270df3..87ee3e96285e0142b71d8c11c02b18647e43974d 2023-11-10 17:09:35 +0000 to 2023-11-14 18:00:46 +0000 - fix error message for duplicate links (rust-lang/cargo#12973) - Only filter out target if its in the package root (rust-lang/cargo#12944) - Ignore changing_spec_relearns_crate_types on windows-gnu (rust-lang/cargo#12972) - fix: do not panic when failed to parse rustc commit-hash (rust-lang/cargo#12965) - query{_vec} use IndexSummary (rust-lang/cargo#12970) - Bump to 0.77.0; update changelog (rust-lang/cargo#12966) - Improve about information of `cargo search` (rust-lang/cargo#12962) - Fix --quiet being used with nested subcommands. (rust-lang/cargo#12959) - make some debug assertion failures more informative (rust-lang/cargo#12963) - refactor(toml): Consistently lead with 'Toml' prefix (rust-lang/cargo#12960) - refactor(toml): Remove unused method (rust-lang/cargo#12961) - Fix non-deterministic behavior in last-use repopulation (rust-lang/cargo#12958) - Add cache garbage collection (rust-lang/cargo#12634) - refactor(toml): Improve consistency (rust-lang/cargo#12954) - Fix typo (rust-lang/cargo#12956) r? ghost
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 15, 2023
Update cargo 15 commits in 6790a5127895debec95c24aefaeb18e059270df3..87ee3e96285e0142b71d8c11c02b18647e43974d 2023-11-10 17:09:35 +0000 to 2023-11-14 18:00:46 +0000 - fix error message for duplicate links (rust-lang/cargo#12973) - Only filter out target if its in the package root (rust-lang/cargo#12944) - Ignore changing_spec_relearns_crate_types on windows-gnu (rust-lang/cargo#12972) - fix: do not panic when failed to parse rustc commit-hash (rust-lang/cargo#12965) - query{_vec} use IndexSummary (rust-lang/cargo#12970) - Bump to 0.77.0; update changelog (rust-lang/cargo#12966) - Improve about information of `cargo search` (rust-lang/cargo#12962) - Fix --quiet being used with nested subcommands. (rust-lang/cargo#12959) - make some debug assertion failures more informative (rust-lang/cargo#12963) - refactor(toml): Consistently lead with 'Toml' prefix (rust-lang/cargo#12960) - refactor(toml): Remove unused method (rust-lang/cargo#12961) - Fix non-deterministic behavior in last-use repopulation (rust-lang/cargo#12958) - Add cache garbage collection (rust-lang/cargo#12634) - refactor(toml): Improve consistency (rust-lang/cargo#12954) - Fix typo (rust-lang/cargo#12956) r? ghost
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 16, 2023
Update cargo 19 commits in 6790a5127895debec95c24aefaeb18e059270df3..2c03e0e2dcd05dd064fcf10cc1050d342eaf67e3 2023-11-10 17:09:35 +0000 to 2023-11-16 04:21:44 +0000 - docs(ref): Find a place to comment on --cap-lints (rust-lang/cargo#12976) - Switch from AtomicU64 to Mutex. (rust-lang/cargo#12981) - If the only path is a loop then counted as the shortest path. (rust-lang/cargo#12977) - fix(resolver): Prefer MSRV, rather than ignore incompatible (rust-lang/cargo#12950) - fix error message for duplicate links (rust-lang/cargo#12973) - Only filter out target if its in the package root (rust-lang/cargo#12944) - Ignore changing_spec_relearns_crate_types on windows-gnu (rust-lang/cargo#12972) - fix: do not panic when failed to parse rustc commit-hash (rust-lang/cargo#12965) - query{_vec} use IndexSummary (rust-lang/cargo#12970) - Bump to 0.77.0; update changelog (rust-lang/cargo#12966) - Improve about information of `cargo search` (rust-lang/cargo#12962) - Fix --quiet being used with nested subcommands. (rust-lang/cargo#12959) - make some debug assertion failures more informative (rust-lang/cargo#12963) - refactor(toml): Consistently lead with 'Toml' prefix (rust-lang/cargo#12960) - refactor(toml): Remove unused method (rust-lang/cargo#12961) - Fix non-deterministic behavior in last-use repopulation (rust-lang/cargo#12958) - Add cache garbage collection (rust-lang/cargo#12634) - refactor(toml): Improve consistency (rust-lang/cargo#12954) - Fix typo (rust-lang/cargo#12956)
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-cli
Area: Command-line interface, option parsing, etc.
A-infrastructure
Area: infrastructure around the cargo repo, ci, releases, etc.
Command-add
Command-bench
Command-build
Command-check
Command-clean
Command-doc
Command-fetch
Command-fix
Command-generate-lockfile
Command-init
Command-install
Command-locate-project
Command-login
Command-logout
Command-metadata
Command-new
Command-owner
Command-package
Command-pkgid
Command-publish
Command-read-manifest
Command-remove
Command-run
Command-rustc
Command-rustdoc
Command-search
Command-tree
Command-uninstall
Command-update
Command-vendor
Command-verify-project
Command-version
Command-yank
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes an issue where
--quiet
doesn't work with commands that have subcommands. This is becauseconfig_configure
only looks at the global and top-level subcommand, and not deeper subcommands. The issue was that--quiet
was not defined as a global flag. This was changed in #6358 in order to give a better help message forcargo test --quiet
. I don't remember if clap just didn't support overriding at the time, or if we just didn't know how it worked. Anyways, it seems to work to override it now, so I think it should be fine to mark it as global.This should bring in
--quiet
more in-line with how--verbose
works. This means that--quiet
is now accepted withcargo report
,cargo help
, andcargo config
.This also fixes
--quiet
withcargo clean gc
.This should also help with supporting
--quiet
with the newcargo owner
subcommands being added in#11879.
As for this diff, the help text changes because the
--quiet
flag is changing position (except for the 3 commands mentioned above where it is now added).Fixes #12957