How to add clap's parsed args to Figment? I couldn't find a clap-provider #5439
-
Hello, We use clap for our CLI applications. I am trying to integrate Figment into one of our clap apps for configuration management. I have everything working in the proper hierarchical order (for us: defaults < file < envvar < command-line). However, I cannot figure out how to feed clap's parsed command line args into Figment, and I couldn't find a clap-figment-provider anywhere. I am sure someone has resolved this question, but I couldn't find anything through Googling. I'd really appreciate your hints or explanations so I can move forward again. :P I've simplified our app to a single parameter in order to figure out this issue. There is a single parameter: duration. Here is the struct, default, config.yaml, and builder(). Thank you for any suggestions and your time!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I do not have any experience with figment, so I can't speak too much to that. You'd likely need to parse your arguments into an Our conversation on layered configs is in #2763. |
Beta Was this translation helpful? Give feedback.
I do not have any experience with figment, so I can't speak too much to that. You'd likely need to parse your arguments into an
ArgMatches
which can be introspected. You might also need to carefully control theid
s (implicitly the field's name) of your arguments.Our conversation on layered configs is in #2763.