Improve parse_args #2

Merged
mdk merged 1 commits from rffontenelle/powrap:rffontenelle-improve-parse_args into main 2023-07-18 12:13:19 +00:00
Contributor

This solves two minor issues of the powrap --help output:

  • First one is that argparse shows short and then long form of --help option, while powrap's arguments show long and then short, causing it to look like:
options:
  -h, --help      show this help message and exit
  --modified, -m  Use git to find modified files ...
  -C GIT_ROOT     To use with --modified to tell ...
  --quiet, -q     Do not show progress bar ...
  ...
  • The other thing is that the exit code is set in multi-line string, but not actually printed as multi-line string. While it looks compacted and OK in the printed help message, I assume that's not the intended so I set RawTextHelpFormatter to make sure the formatting is honored.
exit code: 0:nothing to do 1:would rewrap 127:error running msgcat
This solves two minor issues of the `powrap --help` output: - First one is that argparse shows short and then long form of --help option, while powrap's arguments show long and then short, causing it to look like: ``` options: -h, --help show this help message and exit --modified, -m Use git to find modified files ... -C GIT_ROOT To use with --modified to tell ... --quiet, -q Do not show progress bar ... ... ``` - The other thing is that the exit code is set in multi-line string, but not actually printed as multi-line string. While it looks compacted and OK in the printed help message, I assume that's not the intended so I set RawTextHelpFormatter to make sure the formatting is honored. ``` exit code: 0:nothing to do 1:would rewrap 127:error running msgcat ```
rffontenelle added 1 commit 2023-06-03 15:44:32 +00:00
ci/woodpecker/pr/woodpecker Pipeline was successful Details
a0b4a1eeb0
Improve parse_args
Signed-off-by: rffontenelle <rffontenelle@gmail.com>
mdk approved these changes 2023-07-18 12:11:23 +00:00
Owner

Thanks a lot !!!

Thanks a lot !!!
mdk merged commit a34a9fed11 into main 2023-07-18 12:13:19 +00:00
mdk deleted branch rffontenelle-improve-parse_args 2023-07-18 12:13:19 +00:00
mdk referenced this issue from a commit 2023-07-18 12:13:19 +00:00
Sign in to join this conversation.
No reviewers
mdk
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: AFPy/powrap#2
No description provided.