allow to read environment variables as config parameters
Environment variables must be prefixed with winix_ to be loaded by winix. The winix_ prefix is then removed and the key value converted to lowercase. Sample: evn WINIX_MY_OPTION=TEST123test winix -c config_file This will add my_option to the config with value TEST123test. Environment variables are read last so they will overwrite the values from the configuration files.
This commit is contained in:
@@ -95,8 +95,6 @@ bool Config::ReadConfig(const std::wstring & config_file)
|
||||
|
||||
if( status == pt::SpaceParser::ok )
|
||||
{
|
||||
AssignValues();
|
||||
SetAdditionalVariables();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -107,6 +105,12 @@ bool Config::ReadConfig(const std::wstring & config_file)
|
||||
}
|
||||
|
||||
|
||||
void Config::AssignValuesFromSpace()
|
||||
{
|
||||
AssignValues();
|
||||
SetAdditionalVariables();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Config::AssignValues()
|
||||
|
||||
@@ -854,6 +854,8 @@ public:
|
||||
|
||||
Config();
|
||||
bool ReadConfig(const std::wstring & config_file);
|
||||
void AssignValuesFromSpace();
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user