Closed vbogretsov closed 3 years ago
Can you explain how this is different/better than just doing setting your default to os.Getenv('SOME_VAR')
when you create the parser?
Can you explain how this is different/better than just doing setting your default to
os.Getenv('SOME_VAR')
when you create the parser? For default fromos.Getenv
:
- Environment variable name will not be reflected in help
- Arguments with type
list
will not work
@vbogretsov I would agree with @jkugler on this. This library is about parsing command line arguments. Configuration management and other thins (including handling environment variables) is not part of this library.
I would not want it to turn into another systemd type of thing.
But here is an idea, why not create a library to do just that. And if you want it to do that with argparse, you can use this library under the hood.
A agree with you, closing PR.
Added ability to initialize arguments from environment variables if user not provided values.