This commit is contained in:
Kovid Goyal 2019-04-10 06:35:53 +05:30
commit cbed9a385f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 1 deletions

View File

@ -238,6 +238,9 @@ def main(args=sys.argv):
if len(args) < 2:
parser.print_help()
return 1
if args[1] in ('-h', '--help'):
parser.print_help()
return 0
if args[1] == '--version':
parser.print_version()
return 0

View File

@ -308,7 +308,10 @@ def create_option_parser(args, log):
parser = option_parser()
if len(args) < 3:
print_help(parser, log)
raise SystemExit(1)
if any(x in args for x in ('-h', '--help')):
raise SystemExit(0)
else:
raise SystemExit(1)
input, output = check_command_line_options(parser, args, log)