Open joepio opened 1 year ago
I think something like this could be useful. I think it should at least start as a separate crate like man and completions, maybe clap_dotenv
. I'm ambivalent on whether that is within the clap repo or not.
seems somewhat relevant https://github.com/clap-rs/clap/issues/3131 , so it ask to generate cli args. but in general idea of serialization is common.
Please complete the following tasks
Clap Version
4
Describe your use case
Clap gives the options to either use flags or environment variables to configure their instance.
Generating a
.env
file can help users to setup more complex configurations. We can use theenv = "MY_ENV
marco setting to find out for which arguments we should generate such as file.Describe the solution you'd like
This works for me, but it could be improved. The enums don't show their descriptions at the moment, and there is no hint about data type / boolean type.
I think this feature could be available from
clap::Command::generate_dotenv
, which could return a string.Alternatives, if applicable
No response
Additional Context
No response