Skip to content

Commit

Permalink
Do not show path to executable in the usage
Browse files Browse the repository at this point in the history
This commit removes path to the executable in the usage example.
This is done to reduce indentation of the options, and improve
readability.

Signed-off-by: Ruslan Shymkevych <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
  • Loading branch information
rshym authored and lorc committed Jul 6, 2024
1 parent 8a2e1e2 commit 8374c87
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 @@ -100,7 +100,8 @@ def _handle_shared_opts(description: str,
raise Exception(f"Config file requires version {conf.min_ver}," +
f" while you are running moulin {our_ver}")

prog = f"{sys.argv[0]} {local_conf_file}"
_, exec_name = os.path.split(sys.argv[0])
prog = f"{exec_name} {local_conf_file}"
desc = f"Config file description: {conf.desc}"
config_argparser = argparse.ArgumentParser(description=desc, prog=prog, add_help=False,
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
Expand Down

0 comments on commit 8374c87

Please sign in to comment.