]> git.phdru.name Git - mimedecode.git/blobdiff - mimedecode.py
Forbid filtering from console to console - show usage instead
[mimedecode.git] / mimedecode.py
index f46165b23936cf100e432c44640d0bf293496ac0..34c495f1cb9be2c9f1f4063a9465730aa47c8b80 100755 (executable)
@@ -389,6 +389,10 @@ if __name__ == "__main__":
     else:
         usage(1, 'Too many arguments')
 
+    if (infile is sys.stdin) and (outfile is sys.stdout) and \
+            sys.stdin.isatty() and sys.stdout.isatty():
+        usage(1, 'Filtering from console to console is forbidden')
+
     gopts.outfile = outfile
     decode_file(infile)