Adding an update_from_args/matches() to clap_derive #1836
-
I have an use-case in which I would like to update some fields of a pre-populated struct with the matches provided by clap. It seems not possible right now with the current structopt, would it be an interesting addition to clap_derive? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Could you please define what "pre-populated" and "update" means? Derive needs all fields, short of those marked as skip, and it will rewrite all of them because it has to. An example (possibly pseudocode) would help a lot. |
Beta Was this translation helpful? Give feedback.
-
Which fields are you referring to, exactly? How is derive supposed to know which fields to update and which fields to keep as is? Could you please write an example including the struct, the app, the input, and the expected result from |
Beta Was this translation helpful? Give feedback.
Which fields are you referring to, exactly? How is derive supposed to know which fields to update and which fields to keep as is?
Could you please write an example including the struct, the app, the input, and the expected result from
update_from_matches
? To make sure we are not speaking past each other.