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,8 +256,13 @@ def main():
try:
if fromfile:
with open(inputfilename, 'rt') as flist:
f = flist.read().splitlines()
if inputfilename == '-':
# read from stdin
with sys.stdin as flist:
f = flist.read().splitlines()
else:
with open(inputfilename, 'rt') as flist:
f = flist.read().splitlines()
else:
f = resolvers
if len(f) == 0: