Print usage information if no input file was specified (and no data is available from stdin)

This commit is contained in:
Eduard Braun 2016-08-16 22:08:49 +02:00
parent 57f93efc89
commit c8eb29f54c

View file

@ -3301,6 +3301,9 @@ def parse_args(args=None, ignore_additional_args=False):
infile = sys.stdin.buffer infile = sys.stdin.buffer
except AttributeError: except AttributeError:
infile = sys.stdin infile = sys.stdin
# the user probably does not want to manually enter SVG code into the terminal...
if sys.stdin.isatty():
_options_parser.error("No input file specified, see --help for detailed usage information")
if options.outfilename: if options.outfilename:
outfile = maybe_gziped_file(options.outfilename, "wb") outfile = maybe_gziped_file(options.outfilename, "wb")
else: else: