Skip to content
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

Is it possible to set a StringMap() from environment? #257

Open
scudette opened this issue Dec 12, 2018 · 1 comment
Open

Is it possible to set a StringMap() from environment? #257

scudette opened this issue Dec 12, 2018 · 1 comment

Comments

@scudette
Copy link

If I define a StringMap() I can set multiple key/value pairs by repeating the flag:

 --flag foo=bar --flag baz=bar

But this can not work with environment variables because you can only have one variable of the same name:

APP_FLAG=foo=bar

I could not find a way to set the second parameter with the env var - is this supported? I tried to add a \n to it but it didnt work.

@alecthomas
Copy link
Owner

You should be able to set APP_FLAG to a newline separated list:

APP_FLAG="foo=bar
baz=bar"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants