Merge pull request #38 from will-h/master

Allow '-f -' to denote stdin
This commit is contained in:
Babak Farrokhi 2017-11-04 20:12:25 +03:30 committed by GitHub
commit 4c9aaf921b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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: