X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=mimedecode.py;h=b6f139b6974ba2cb141d9c6999085cfdce22a02a;hb=4467e66adb26be6409c68e7ff5408776b224170a;hp=9aab1b3e93c499fd9df152484b8481d0dd411f0e;hpb=29fcdcb768fbd333ee3aefa94336013bbcb6f298;p=mimedecode.git diff --git a/mimedecode.py b/mimedecode.py index 9aab1b3..b6f139b 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -350,9 +350,12 @@ if __name__ == "__main__": la = len(arguments) if la == 0: gopts.input_filename = '-' - gopts.output_filename = '-' infile = sys.stdin - outfile = sys.stdout + if gopts.output_filename: + outfile = open(gopts.output_filename, 'w') + else: + gopts.output_filename = '-' + outfile = sys.stdout elif la in (1, 2): if (arguments[0] == '-'): gopts.input_filename = '-'