-
Notifications
You must be signed in to change notification settings - Fork 0
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
Example using clap v3 derive #4
Comments
@storyfeet when you have a moment, this would greatly help with getting started! Also, the |
Hi, Sorry, I don't know why I didn't see this before, I do have a watch on the repo. I'm looking at the new clap with derive now, and I don't think clap_conf works with it as things stand, It'll take some reading to work out how to make it work. |
Thanks @storyfeet ! You may also be interested in clap-rs/clap#2763 discussion and a more specific clap-rs/clap#1206 issue. |
The problem working with the derive is the type it creates does not have a general "get" method, instead each required property ie "name" holds an but clap_conf relies on having a get general mechanism for the Getter Trait which is used to combine the items. I believe this could also be derived, but if I'm honest I'm in no hurry to start learning to write these kinds of macros. (feel free to have a go) But by the time you've done that, you might as well just use the "builder" as it loses the type information to go back to a string return anyway. |
Update: clap-rs/clap#1206 has just been fixed, so you can iterate over args now. |
Could you provide an example of how to integrate with a clap v3 derive app? I'd like to be able to have configuration file and/or environment variables provide defaults, then allow overrides via clap command line args.
The text was updated successfully, but these errors were encountered: