xoa.cfgm.cfgargparse¶
-
xoa.cfgm.cfgargparse(cfgspecfile, parser, cfgfileopt='cfgfile', cfgfile='config.cfg', exc=[], extraopts=None, args=None, **kwargs)[source]¶ Merge configuration and commandline arguments
- Parameters
cfgspecfile – Config specification file (.ini).
parser –
ArgumentParserinstance.cfgfileopt (optional) – Name of the option used to specify the user config file. Example:
'cfgfile'creates the option--cfgfile=<config file>.cfgfile (optional) – Default name for the loaded config file.
exc (optional) – Config option name that must not be used to generated a commandline option.
**kwargs – Extra params are passed to
ConfigManagerinitialization.
- Returns
ConfigObjTasks –
Initialize a default configuration (
ConfigManager) from the specification file given bycfgspecfile.Generate associated commandline options.
Load a user configuration file (specified with the option whose name is given by
cfgfileopt).Patch this configuration with user supplied options retrieved using the
ArgumentParserparserparser.
Technically it combines
ConfigManagerandConfigManager.arg_parse()