-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose an API for parsing Strings #15
Comments
I'm curious, what was the use-case you had where you had a |
I was using structopt as well, which can get values from env vars, and I was setting the default values of such "env" vars with dotenv lol by including such "defaults" files and parsing their contents So I'd parse from &str and I'd not necessarily push into the local env vars, id first get the parsed Hashmap of vars=value as well |
I didn't realize that structopt can fill in values from environment variables, interesting. If it can do that is there a reason that you did not run |
Oh in some cases I preferred to read strings, I think it was for compile-time assertion. So we could use config files, command line args, env vars and .env files (multiple, recursive, etc), disable the env vars from the shell and also link to some default .env files as env vars at compile-time, as a default fallback (structopt read values as static strings as seen in TeXitoi/structopt#150 ). We probably should just have stuck to config files and env vars, but oh well.. ^^ |
I'd use In fact I may want to use both |
+1 I think this would be useful for unit tests! |
I once had an use-case where a String (instead of strictly a file/args) would need to be parsed.
Is it possible to expose an API for String parsing?
The text was updated successfully, but these errors were encountered: