This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Bump clap to 4.0.x and adjust to best practices #12381
Merged
paritytech-processbot
merged 26 commits into
paritytech:master
from
skunert:skunert/clap-3222
Oct 18, 2022
Merged
Bump clap to 4.0.x and adjust to best practices #12381
paritytech-processbot
merged 26 commits into
paritytech:master
from
skunert:skunert/clap-3222
Oct 18, 2022
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
skunert
added
A0-please_review
Pull request needs code review.
B0-silent
Changes should not be mentioned in any release notes
C1-low
PR touches the given topic and has a low impact on builders.
D3-trivial 🧸
PR contains trivial changes in a runtime directory that do not require an audit
labels
Sep 28, 2022
Converting to draft as clap 4.0 is already out, will update this PR |
skunert
changed the title
Bump clap to 3.2.22 and adjust to best practices
Bump clap to 4.0.9 and adjust to best practices
Oct 7, 2022
skunert
changed the title
Bump clap to 4.0.9 and adjust to best practices
Bump clap to 4.0.x and adjust to best practices
Oct 9, 2022
This was referenced Oct 9, 2022
bkchr
approved these changes
Oct 9, 2022
Co-authored-by: Bastian Köcher <git@kchr.de>
koute
approved these changes
Oct 17, 2022
match self { | ||
Self::Interpreted => write!(f, "Interpreted"), | ||
Self::Compiled => write!(f, "Compiled"), | ||
const INTERPRETED_NAME: &str = "interpreted-i-know-what-i-do"; |
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.
Any reason why you added this const for the interpreted variant but not for the compiled one?
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.
The compiled one follows the name of the enum precisely. The interpreted one has this "interpreted-i-know-what-i-do" extra name. But yeah maybe not necessary.
michalkucharczyk
approved these changes
Oct 17, 2022
radupopa2010
approved these changes
Oct 17, 2022
sergejparity
approved these changes
Oct 17, 2022
bot merge |
ark0f
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Feb 27, 2023
* Bump clap to 3.2.22 * Replace `from_os_str` with `value_parser` * Replace `from_str` and `try_from_str` with `value_parser` * Move possible_values to the new format * Remove unwanted print * Add missing match branch * Update clap to 4.0.9 and make it compile * Replace deprecated `clap` macro with `command` and `value` * Move remaining `clap` attributes to `arg` * Remove no-op value_parsers * Adjust value_parser for state_version * Remove "deprecated" feature flag and bump to 4.0.11 * Improve range Co-authored-by: Bastian Köcher <git@kchr.de> * Apply suggestions * Trigger CI * Fix unused error warning * Fix doc errors * Fix ArgGroup naming conflict * Change default_value to default_value_t * Use 1.. instead of 0.. Co-authored-by: Bastian Köcher <git@kchr.de>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A0-please_review
Pull request needs code review.
B0-silent
Changes should not be mentioned in any release notes
C1-low
PR touches the given topic and has a low impact on builders.
D3-trivial 🧸
PR contains trivial changes in a runtime directory that do not require an audit
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.
Update to latest clap version.
Change Overview
arg_enum
changed tovalue_enum
, implementations ofArgEnum
changed toValueEnum
conflicts_with
now needs the snake-case arguments (e.g.conflicts_with_all = ["json_input"]
vsconflicts_with_all = ["json-input"]
)multiple_values(true)
is transformed tonum_args = 0..
#[clap(possible_values = ["1", "2"])]
transformed to#[arg(value_parser = PossibleValuesParser::new(["1", "2"])]
#[clap(parse(from_os_str))]
is replaced by just#[arg()]
due to changed defaultsparse = ...
has been replaced byvalue_parser = ...
clap
was replacedvalue
for enumsarg
for argumentscommand
for commandspolkadot companion: paritytech/polkadot#6128
cumulus companion: paritytech/cumulus#1745