aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/truncate-stream6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/truncate-stream b/scripts/truncate-stream
index 60679d30..7de5c953 100755
--- a/scripts/truncate-stream
+++ b/scripts/truncate-stream
@@ -114,7 +114,11 @@ if not (opt.ifn and opt.ofn):
print("You need at least --input and --output")
exit(1)
-f = open(opt.ifn, 'r')
+if opt.ifn == "-":
+ f = sys.stdin
+else:
+ f = open(opt.ifn, 'r')
+
g = open(opt.ofn, 'w')
start_after = opt.start
stop_after = opt.stop