Prioritise between subcommand, global, env vars, and config file #5188
Replies: 2 comments
-
You can check Support in derive is being tracked in #3846 |
Beta Was this translation helpful? Give feedback.
-
I was struggling to find a solution to the exact same problem using derive. Seems like Thank you @epage for such precious information! :) |
Beta Was this translation helpful? Give feedback.
-
I want to support 3 different ways of providing input:
Additionally the global and subcommand arguments have defaults and environment variables set, so this logic is desired:
config.json
main.rs
Cargo.toml
I guess my first question so I can implement this logic is:
how do I know whether a variable was provided by the user, was provided in an env var, or was provided as a default?
Beta Was this translation helpful? Give feedback.
All reactions