-
Notifications
You must be signed in to change notification settings - Fork 187
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
Migrate from structopt
to clap
v3
#1293
Conversation
`clap` v3 added support for a `structopt`-like parser derive usage. `structopt` is now in maintenance mode (https://docs.rs/structopt/latest/structopt/#maintenance); it is recommended to migrate to `clap`. Structs to parse CLI arguments have been renamed to `Args` for consistency.
A new doc preview is ready to view. |
A new generated diff is ready to view.
|
Rust Wrk benchmark report:Duration: 90 sec, Connections: 32, Threads: 2
|
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.
Thanks for taking the time to do this!
/// The path to the smithy-rs repo folder. | ||
#[structopt(long, parse(from_os_str))] | ||
#[clap(long, parse(from_os_str))] |
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.
I'm not 100% on this, but the parse(from_os_str)
might not be needed on the PathBufs anymore.
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.
AFAICS they're still needed to parse non-UTF-8 paths clap-rs/clap#3496.
@@ -50,7 +50,7 @@ impl Opt { | |||
} | |||
|
|||
fn main() -> anyhow::Result<()> { | |||
let opt = Opt::from_args().validate()?; | |||
let opt = Args::parse().validate()?; |
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.
It looks like CI is failing since the Docker image tests that all the tools are in the right place by calling them with their --version
flag, and I guess structopt
must have been giving us that flag for free.
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.
Thanks! Fixed in 5365a83
A new doc preview is ready to view. |
A new generated diff is ready to view.
|
Rust Wrk benchmark report:Duration: 90 sec, Connections: 32, Threads: 2
|
…-`structopt`-to-`clap`-v3
c9e8835
to
959fc45
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. Rust Wrk benchmark report:Duration: 90 sec, Connections: 32, Threads: 2
|
clap
v3 added support for astructopt
-like parser derive usage.structopt
is now in maintenance mode(https://docs.rs/structopt/latest/structopt/#maintenance); it is
recommended to migrate to
clap
.Structs to parse CLI arguments have been renamed to
Args
forconsistency.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.