From c8eb29f54cdb12b702a2065be124c852cc40742b Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Tue, 16 Aug 2016 22:08:49 +0200 Subject: [PATCH] Print usage information if no input file was specified (and no data is available from `stdin`) --- scour/scour.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scour/scour.py b/scour/scour.py index 430cfa1..b41034b 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -3301,6 +3301,9 @@ def parse_args(args=None, ignore_additional_args=False): infile = sys.stdin.buffer except AttributeError: 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: outfile = maybe_gziped_file(options.outfilename, "wb") else: