From 15808207a8ed63195d986317d9eea7f587a71d23 Mon Sep 17 00:00:00 2001 From: Ruslan Shymkevych Date: Fri, 5 Jul 2024 21:34:04 +0300 Subject: [PATCH] Display default values for `help-config` This commit adds the output of the default value for each option printed by the `--help-config`. Signed-off-by: Ruslan Shymkevych Reviewed-by: Volodymyr Babchuk --- moulin/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moulin/main.py b/moulin/main.py index 00893e6..9a1edf0 100644 --- a/moulin/main.py +++ b/moulin/main.py @@ -102,7 +102,8 @@ def _handle_shared_opts(description: str, prog = f"{sys.argv[0]} {local_conf_file}" desc = f"Config file description: {conf.desc}" - config_argparser = argparse.ArgumentParser(description=desc, prog=prog, add_help=False) + config_argparser = argparse.ArgumentParser(description=desc, prog=prog, add_help=False, + formatter_class=argparse.ArgumentDefaultsHelpFormatter) for parameter in conf.get_parameters().values(): config_argparser.add_argument(f"--{parameter.name}", choices=[x.name for x in parameter.variants.values()],