Improve parse_args

Signed-off-by: rffontenelle <rffontenelle@gmail.com>
This commit is contained in:
rffontenelle 2023-06-03 15:35:16 +00:00
parent c5042aa2d8
commit a0b4a1eeb0

View File

@ -94,14 +94,15 @@ def parse_args():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
prog="powrap", prog="powrap",
description="Ensure po files are using the standard gettext format", description="Ensure po files are using the standard gettext format",
formatter_class=argparse.RawTextHelpFormatter,
epilog="""exit code: epilog="""exit code:
0:nothing to do 0:nothing to do
1:would rewrap 1:would rewrap
127:error running msgcat""", 127:error running msgcat""",
) )
parser.add_argument( parser.add_argument(
"--modified",
"-m", "-m",
"--modified",
action="store_true", action="store_true",
help="Use git to find modified files instead of passing them as arguments.", help="Use git to find modified files instead of passing them as arguments.",
) )
@ -114,11 +115,11 @@ def parse_args():
default=Path.cwd(), default=Path.cwd(),
) )
parser.add_argument( parser.add_argument(
"--quiet", "-q", action="store_true", help="Do not show progress bar." "-q", "--quiet", action="store_true", help="Do not show progress bar."
) )
parser.add_argument( parser.add_argument(
"--diff",
"-d", "-d",
"--diff",
action="store_true", action="store_true",
help="Don't write the files back, just output a diff for each file on stdout " help="Don't write the files back, just output a diff for each file on stdout "
"(implies --check).", "(implies --check).",