summaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-05 14:41:01 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-05 15:26:20 -0500
commit9b6cbff43b557981c1f52d70c12b36164dbf8089 (patch)
tree1999a4d96635a24df4d4e1d507416bd04773d0a5 /devtools
parent580743e54163b3a5bb0f2e049fc92b2da86f60ff (diff)
downloadgpsd-9b6cbff43b557981c1f52d70c12b36164dbf8089.tar.gz
Test-machinery improvements. All regression tests pass. PPS is live.
Diffstat (limited to 'devtools')
-rwxr-xr-xdevtools/striplog30
1 files changed, 19 insertions, 11 deletions
diff --git a/devtools/striplog b/devtools/striplog
index bb73044e..f3e21a48 100755
--- a/devtools/striplog
+++ b/devtools/striplog
@@ -10,19 +10,27 @@
#
import getopt, sys
-firstline = False
-(options, argumwnts) = getopt.getopt(sys.argv[1:], "1")
+secondline = firstline = False
+(options, arguments) = getopt.getopt(sys.argv[1:], "12")
for (switch, val) in options:
if (switch == '-1'):
firstline = True
+ if (switch == '-2'):
+ secondline = True
-if firstline:
- sys.stdin.readline()
-else:
- while True:
- line = sys.stdin.readline()
- if line[0] != '#':
- break
- sys.stdout.write(line)
+try:
+ if firstline:
+ sys.stdin.readline()
+ elif secondline:
+ sys.stdin.readline()
+ sys.stdin.readline()
+ else:
+ while True:
+ line = sys.stdin.readline()
+ if line[0] != '#':
+ break
+ sys.stdout.write(line)
-sys.stdout.write(sys.stdin.read())
+ sys.stdout.write(sys.stdin.read())
+except KeyBoardInterrupt:
+ pass