mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Merge branch 'error-codes' of https://github.com/eli-schwartz/calibre
This commit is contained in:
commit
cbed9a385f
@ -238,6 +238,9 @@ def main(args=sys.argv):
|
|||||||
if len(args) < 2:
|
if len(args) < 2:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
return 1
|
return 1
|
||||||
|
if args[1] in ('-h', '--help'):
|
||||||
|
parser.print_help()
|
||||||
|
return 0
|
||||||
if args[1] == '--version':
|
if args[1] == '--version':
|
||||||
parser.print_version()
|
parser.print_version()
|
||||||
return 0
|
return 0
|
||||||
|
@ -308,7 +308,10 @@ def create_option_parser(args, log):
|
|||||||
parser = option_parser()
|
parser = option_parser()
|
||||||
if len(args) < 3:
|
if len(args) < 3:
|
||||||
print_help(parser, log)
|
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)
|
input, output = check_command_line_options(parser, args, log)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user