summaryrefslogtreecommitdiff
path: root/kvmd/apps/__init__.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-06-07 17:16:05 +0300
committerMaxim Devaev <[email protected]>2022-06-07 17:16:05 +0300
commitced52d739c19f3ad544aa881b40ed16e1f42975f (patch)
tree0caa63fc482e1335d2a6840d8669a119a0684ef9 /kvmd/apps/__init__.py
parent2bcea6d522aaef44da04aa088eb88ab584375897 (diff)
refactoring
Diffstat (limited to 'kvmd/apps/__init__.py')
-rw-r--r--kvmd/apps/__init__.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/kvmd/apps/__init__.py b/kvmd/apps/__init__.py
index 6d7fa295..a13bdeb0 100644
--- a/kvmd/apps/__init__.py
+++ b/kvmd/apps/__init__.py
@@ -120,22 +120,22 @@ def init(
argv = (argv or sys.argv)
assert len(argv) > 0
- args_parser = argparse.ArgumentParser(
+ parser = argparse.ArgumentParser(
prog=(prog or argv[0]),
description=description,
add_help=add_help,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
- args_parser.add_argument("-c", "--config", dest="config_path", default="/etc/kvmd/main.yaml", type=valid_abs_file,
- help="Set config file path", metavar="<file>")
- args_parser.add_argument("-o", "--set-options", dest="set_options", default=[], nargs="+",
- help="Override config options list (like sec/sub/opt=value)", metavar="<k=v>",)
- args_parser.add_argument("-m", "--dump-config", dest="dump_config", action="store_true",
- help="View current configuration (include all overrides)")
+ parser.add_argument("-c", "--config", dest="config_path", default="/etc/kvmd/main.yaml", type=valid_abs_file,
+ help="Set config file path", metavar="<file>")
+ parser.add_argument("-o", "--set-options", dest="set_options", default=[], nargs="+",
+ help="Override config options list (like sec/sub/opt=value)", metavar="<k=v>",)
+ parser.add_argument("-m", "--dump-config", dest="dump_config", action="store_true",
+ help="View current configuration (include all overrides)")
if check_run:
- args_parser.add_argument("--run", dest="run", action="store_true",
- help="Run the service")
- (options, remaining) = args_parser.parse_known_args(argv)
+ parser.add_argument("--run", dest="run", action="store_true",
+ help="Run the service")
+ (options, remaining) = parser.parse_known_args(argv)
if options.dump_config:
_dump_config(_init_config(
@@ -160,7 +160,7 @@ def init(
"Make sure you understand exactly what you are doing!"
)
- return (args_parser, remaining, config)
+ return (parser, remaining, config)
# =====