Replace clap with structopt#648
Conversation
|
The handling of the parameters is indeed simpler this way, but according to clap-rs/clap#1574 (comment) structopt is going to be deprecated in favor of clap_derive. |
|
I've used Besides that, between claps beta 1 and 2 a long time passed by, so it'll probably still take quite a long while until the full 3.0 is released. With all that said I would recommend using structopt now. It's unclear when clap 3.0 will be out and the upgrade from structopt to clap is very easy (which I would happily do in the future). |
calixteman
left a comment
There was a problem hiding this comment.
I don't see any obvious errors and overall it looks better with structopt.
So r+.
|
Thanks for the merge ❤️ I extra diffed the help output before and after to make sure the visible interface has as few changes as possible. |
Thank you for the contribution 😉 |
This replaces the manual setup of argument parsing through clap with structopt. It makes input handling in my opinion more simple and avoids the mismatch between argument definition and retrieval as structopt makes sure that all input parameters can be converted into the defined types.
I diffed the old help output with the new one to make sure that the differences are kept to a minimum.
While implementing the changes I potentially found a bug in regards to the
path_mappingargument. It is defined as an argument that takes 1 or more values, thus allowing to give multiple values at once. Later it is parsed as a single value only though. In this new version it correctly allows only one value as input.