ConfigArgParse
ConfigArgParse copied to clipboard
Parse environment variables in config file
I would like to know if there's a way to use environment variables in a config file. In the following example, $HOME and $CUDA will not be converted to the corresponding values:
data-dir=$HOME/data
cuda-dir=$CUDA
Thank you very much in advance for your help!
This is not currently supported. It's non-trivial to add this behavior in a robust way.
or it might not be that difficult. If you still need this, please submit a PR, adding an option to the ArgParser constructor to enable this behavior (since enabling it by default might break existing config files).
Then run os.path.expandvars() on config file value strings.