-
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
Port cargo to clap3 #10265
Merged
Merged
Port cargo to clap3 #10265
Commits on Jan 6, 2022
-
- One parser change found by `cargo_config::includes` is that clap 2 would ignore any values after a `=` for flags. `cargo config --show-origin` is a flag but the test passed `--show-origin=yes` which happens to give the desired result for that test but is the same as `--show-origin=no` or `--show-origin=alien-invasion`. - The parser now panics when accessing an undefined attribute but clap takes advantage of that for sharing code across commands that have different subsets of arguments defined. I've extended clap so we can "look before you leap" and put the checks at the argument calls to start off with so its very clear what is tenuously shared. This allows us to go in either direction in the future, either addressing how we are sharing between commands or by moving this down into the extension methods and pretending this clap feature doesn't exist - On that topic, a test found clap-rs/clap#3263. For now, there is a hack in clap. Depending on how we fix that in clap for clap 4.0, we might need to re-address things in cargo. - `value_of_os` now requires setting `allow_invalid_utf8`, otherwise it asserts. To help catch this, I updated the argument definitions associated with lookups reported by: - `rg 'values?_os' src/` - `rg 'values?_of_os' src/` - clap now reports `2` for usage errors, so we had to bypass clap's `exit` call to keep the same exit code. BREAKING CHANGE: API now uses clap3
Configuration menu - View commit details
-
Copy full SHA for f17ecaf - Browse repository at this point
Copy the full SHA f17ecafView commit details -
Configuration menu - View commit details
-
Copy full SHA for 88a122c - Browse repository at this point
Copy the full SHA 88a122cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5435b26 - Browse repository at this point
Copy the full SHA 5435b26View commit details -
Configuration menu - View commit details
-
Copy full SHA for f3ec865 - Browse repository at this point
Copy the full SHA f3ec865View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2aa4e9f - Browse repository at this point
Copy the full SHA 2aa4e9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for f9b28cf - Browse repository at this point
Copy the full SHA f9b28cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for aed0312 - Browse repository at this point
Copy the full SHA aed0312View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cd062e - Browse repository at this point
Copy the full SHA 5cd062eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ab4d0c - Browse repository at this point
Copy the full SHA 0ab4d0cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 24f301b - Browse repository at this point
Copy the full SHA 24f301bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e08a30 - Browse repository at this point
Copy the full SHA 6e08a30View commit details -
refactor: Resolve Arg::multiple deprecation
Note: `cargo vendor --sync` did not use `multi_opt` and so it has both multiple occurrences **and** multiple values. If we want to deprecate this, we'll need `unstable-grouped` to be stablized (or pin our clap version) and ensure each group has only 1 value.
Configuration menu - View commit details
-
Copy full SHA for 92fa72d - Browse repository at this point
Copy the full SHA 92fa72dView commit details
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.