You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on adding env var support to a fairly large number of flags, with the Derive API. It would be great if we could specify a common prefix for all the env vars, without having to spell it out for each flag.
Please complete the following tasks
Clap Version
3.1.2
Describe your use case
I'm working on adding env var support to a fairly large number of flags, with the Derive API. It would be great if we could specify a common prefix for all the env vars, without having to spell it out for each flag.
Describe the solution you'd like
Something like
all_env_prefix = "FOO_"
, e.g.Alternatives, if applicable
The current alternative is to spell out each of the names with the
env = "..."
syntax, but that's very repetitive.A more general approach would be to allow specifying a callback for mapping flag names to env vars, e.g.
... but I'm not sure that's worth the overhead of supporting callbacks, for which there is no precedent AFAIK.
Additional Context
This seems similar to #2463 but for env vars renaming.
The text was updated successfully, but these errors were encountered: