Sep-20-2020, 02:28 PM
Hello
Following is the part of my code:
Thanks
Following is the part of my code:
help_msg = 'Encode video file(s) recursively to HEVC 10Bit.' parser = argparse.ArgumentParser(description=help_msg) parser.add_argument('-l', '--list', nargs='?', const=PWD, metavar='PATH', help='List all video files.') parser.add_argument('-c', '--hevc', nargs='?', const=PWD, metavar='PATH', help='List all HEVC video files.') parser.add_argument('-x', '--other', nargs='?', const=PWD, metavar='PATH', help='List all video files other than HEVC.') args = parser.parse_args()and this is the output:
Output:$ hvc -h
usage: hvc [-h] [-l [PATH]] [-c [PATH]] [-x [PATH]]
Encode video file(s) recursively to HEVC 10Bit.
optional arguments:
-h, --help show this help message and exit
-l [PATH], --list [PATH]
List all video files.
-c [PATH], --hevc [PATH]
List all HEVC video files.
-x [PATH], --other [PATH]
List all video files other than HEVC.
I want the 'optional arguments' part of help output be printed in the same line. Like this:Output:optional arguments:
-h, --help show this help message and exit
-l [PATH], --list [PATH] List all video files.
-c [PATH], --hevc [PATH] List all HEVC video files.
-x [PATH], --other [PATH] List all video files other than HEVC.
How do I make it?Thanks