Skip to content

Commit

Permalink
Use sys.exit
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Apr 17, 2022
1 parent 39a801a commit 9748fab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/python_minifier/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,16 @@ def parse_args():
# Handle some invalid argument combinations
if '-' in args.path and len(args.path) != 1:
sys.stderr.write('error: multiple path arguments, reading from stdin not allowed\n')
exit(1)
sys.exit(1)
if '-' in args.path and args.in_place:
sys.stderr.write('error: reading from stdin, --in-place is not valid\n')
exit(1)
sys.exit(1)
if len(args.path) > 1 and not args.in_place:
sys.stderr.write('error: multiple path arguments, --in-place required\n')
exit(1)
sys.exit(1)
if len(args.path) == 1 and os.path.isdir(args.path[0]) and not args.in_place:
sys.stderr.write('error: path ' + args.path[0] + ' is a directory, --in-place required\n')
exit(1)
sys.exit(1)

return args

Expand Down

0 comments on commit 9748fab

Please sign in to comment.