diff options
-rwxr-xr-x | devtools/striplog | 30 | ||||
-rwxr-xr-x | regress-driver | 4 |
2 files changed, 21 insertions, 13 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 diff --git a/regress-driver b/regress-driver index 13ee6d96..862e52cd 100755 --- a/regress-driver +++ b/regress-driver @@ -96,7 +96,7 @@ if [ -t 0 ] then baton=false fi -if ] $baton = true ] +if [ $baton = true ] then opts="$opts -b" fi @@ -158,7 +158,7 @@ case $mode in echo "Testing super-raw mode..." >&2 for f in $*; do ${PYTHON} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts -r '?WATCH={"enable":true,"raw":2}' $opts ${f} \ - | ./devtools/striplog -1 >${TMP}/test1-$$.chk; + | ./devtools/striplog -2 >${TMP}/test1-$$.chk; ./devtools/striplog <${f} >${TMP}/test2-$$.chk; cmp ${TMP}/test[12]-$$.chk; done; rm ${TMP}/test[12]-$$.chk |