Commit 211f7cf0 authored by Dominik Rimpf's avatar Dominik Rimpf
Browse files

CHG: renamed config parameter

parent e8297c5b
Pipeline #114523 passed with stage
in 22 seconds
...@@ -20,9 +20,8 @@ class ArgumentParser(argparse.ArgumentParser): ...@@ -20,9 +20,8 @@ class ArgumentParser(argparse.ArgumentParser):
formatter_class=argparse.RawTextHelpFormatter, formatter_class=argparse.RawTextHelpFormatter,
**kwargs **kwargs
): ):
super().__init__(formatter_class=formatter_class, super().__init__(formatter_class=formatter_class, epilog=epilog, **kwargs)
epilog=epilog, **kwargs) self.add_argument('--auth-config',
self.add_argument('--config', '-c',
default=os.path.expanduser('~/.config/netdb_client.ini'), default=os.path.expanduser('~/.config/netdb_client.ini'),
help='config file path (default: %(default)s)') help='config file path (default: %(default)s)')
self.add_argument('--base-url', '-b', self.add_argument('--base-url', '-b',
...@@ -41,8 +40,8 @@ class ArgumentParser(argparse.ArgumentParser): ...@@ -41,8 +40,8 @@ class ArgumentParser(argparse.ArgumentParser):
def parse_args(self, args=None, namespace=None): def parse_args(self, args=None, namespace=None):
args = super().parse_args(args, namespace) args = super().parse_args(args, namespace)
config = configparser.ConfigParser() config = configparser.ConfigParser()
if os.path.isfile(os.path.expanduser(args.config)): if os.path.isfile(os.path.expanduser(args.auth_config)):
config.read(os.path.expanduser(args.config)) config.read(os.path.expanduser(args.auth_config))
def load_configoption(option): def load_configoption(option):
if getattr(args, option) is None: if getattr(args, option) is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment