Passing default/override arguments via the environment #3714
MoSal
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
Overall the approach seems fine and is similar to what is done for argfile. Doing this more generally and in clap would require resolving some issues around subcommands and anything else related to the similar #2836 FYI shlex would be easy to update to work on bytes which hopefully could then be made to work with os_str_bytes: comex/rust-shlex#12 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So, I wanted to add this feature to one of my tools. I didn't find a way to do it with clap alone. So I looked around. Found shlex, adapted it to work with
OsStr
/OsString
types.Then, getting all arguments including defaults/overrides via the environment is as simple as:
Did I go about this the right way, or did I miss something?
Beta Was this translation helpful? Give feedback.
All reactions