-
Notifications
You must be signed in to change notification settings - Fork 1
Use clap
instead of getopts
to parse cli args
#27
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
Conversation
Would you please post the link to the original repository of The main problem was that |
https://github.com/clap-rs/clap The nice thing here are two things. The first one is, that the cli args are defined in the rust code itself and are turned into the cli at compile time. This is way shorter then declaring every single option with a function call or something similar. The other being, that the input methods are turned into subcommands, which means, that no check is necessary, if it is specified, or if there are multiple specified. |
5446e14
to
bb27308
Compare
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.
Thank you for your recent changes! I left some comments regarding further enhancements.
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.
Thank you for your latest changes! I left some feedback for you!
By the way: I took a look at the Further readings: |
`clap` allows using subcommands, which are helpfull for the input methods. This also makes the main method a lot shorter, since there is no need to add every single command line option per manually. This is handled by the `derive` feature of `clap` and the new `Args` struct.
While this might be true, I have multiple reasons against that. For one this project is currently only developed on windows. It is also not really up to collaboration, so it does not really need to be portable at the time being. Also requiring |
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.
There are still some small language issues.
You forgot numerous docstrings which still carry Imperative / Present. Since you oversaw them multiple times, I would like to suggest to revert the Indicative / Simple Present. It does not add anything to the source files. |
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.
Here are still some open points I would to ask you to change.
Renames field verbose in Args to better fit getter is_verbose.
Also moves related structs and enums closer to Args as well.
This makes the main function a lot easier, since Args is not moved into Filter anymore.
This adds/improves documentation in `Args` and fixes the documentation in other places. Also this orders the fields of `Args` so that the `Filter` related fields come last, since they are the least important, and take up a lot of space.
I open this pull request to further discuss things and ensure feature equality, before merging it into main.
Pinging @kevinmatthes