Allow '-f -' to denote stdin
This commit is contained in:
parent
9caa006e5b
commit
f1807d34ea
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user