Skip to content

Commit

Permalink
Display default values for help-config
Browse files Browse the repository at this point in the history
This commit adds the output of the default value for each
option printed by the `--help-config`.

Signed-off-by: Ruslan Shymkevych <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
  • Loading branch information
rshym committed Jul 6, 2024
1 parent 4034dc4 commit 1580820
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion moulin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()],
Expand Down

0 comments on commit 1580820

Please sign in to comment.