mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
show default values for --help
This commit is contained in:
@@ -120,11 +120,16 @@ def init(
|
|||||||
argv = (argv or sys.argv)
|
argv = (argv or sys.argv)
|
||||||
assert len(argv) > 0
|
assert len(argv) > 0
|
||||||
|
|
||||||
args_parser = argparse.ArgumentParser(prog=(prog or argv[0]), description=description, add_help=add_help)
|
args_parser = argparse.ArgumentParser(
|
||||||
args_parser.add_argument("-c", "--config", dest="config_path", default="/etc/kvmd/main.yaml", metavar="<file>",
|
prog=(prog or argv[0]),
|
||||||
type=valid_abs_file, help="Set config file path")
|
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="+",
|
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",
|
args_parser.add_argument("-m", "--dump-config", dest="dump_config", action="store_true",
|
||||||
help="View current configuration (include all overrides)")
|
help="View current configuration (include all overrides)")
|
||||||
if check_run:
|
if check_run:
|
||||||
|
|||||||
Reference in New Issue
Block a user