|
|
|
|
@ -36,12 +36,9 @@ def debug(line):
|
|
|
|
|
debug(pformat(args)) |
|
|
|
|
|
|
|
|
|
# Set up the file handle, <file> or stdin |
|
|
|
|
if cmd.filename: |
|
|
|
|
handle=open(cmd.filename) |
|
|
|
|
else: |
|
|
|
|
handle=sys.stdin |
|
|
|
|
# Go over the handle, line by line |
|
|
|
|
for line in handle: |
|
|
|
|
with open(cmd.filename,'r') if cmd.filename else sys.stdin as handle: |
|
|
|
|
# Go over the handle, line by line |
|
|
|
|
for line in handle: |
|
|
|
|
# Start buffering if we hit the start regex |
|
|
|
|
if re.search(start,line): |
|
|
|
|
buffering=True |
|
|
|
|
|