Allow '-f -' to denote stdin

This commit is contained in:
Will Hargrave 2017-11-01 21:34:56 +00:00
parent 9caa006e5b
commit f1807d34ea

View File

@ -256,6 +256,11 @@ def main():
try: try:
if fromfile: if fromfile:
if inputfilename == '-':
# read from stdin
with sys.stdin as flist:
f = flist.read().splitlines()
else:
with open(inputfilename, 'rt') as flist: with open(inputfilename, 'rt') as flist:
f = flist.read().splitlines() f = flist.read().splitlines()
else: else: