diff options
author | Maxim Devaev <[email protected]> | 2022-01-21 07:26:41 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-01-21 07:26:41 +0300 |
commit | 88909355f946c0afc92ba28f62e31dc1c0f2bd2f (patch) | |
tree | 894b4400e9834a3dd8a2dae2b442fea97c9c7712 /kvmd/apps/__init__.py | |
parent | bdc2a317e536dca33048dc8e308fe9a7e20ecc15 (diff) |
show default values for --help
Diffstat (limited to 'kvmd/apps/__init__.py')
-rw-r--r-- | kvmd/apps/__init__.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/kvmd/apps/__init__.py b/kvmd/apps/__init__.py index 4b7a6588..d40e2feb 100644 --- a/kvmd/apps/__init__.py +++ b/kvmd/apps/__init__.py @@ -120,11 +120,16 @@ def init( argv = (argv or sys.argv) assert len(argv) > 0 - args_parser = argparse.ArgumentParser(prog=(prog or argv[0]), description=description, add_help=add_help) - args_parser.add_argument("-c", "--config", dest="config_path", default="/etc/kvmd/main.yaml", metavar="<file>", - type=valid_abs_file, help="Set config file path") + args_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)") + 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)") if check_run: |