citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 893215f461ec67b9baded116b7359a2563ef4c19
parent 7da2de8be1be0df5339f021acc5a158b78c58463
Author: Kyle Milz <kyle@0x30.net>
Date:   Sun,  4 Dec 2016 13:30:50 -0700

src/check: delete dirs variable

Diffstat:
Msrc/check.sh | 20+++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/check.sh b/src/check.sh @@ -18,6 +18,7 @@ set -eu args=`getopt o: $*` + set -- $args while [ $# -ne 0 ]; do case "$1" @@ -30,9 +31,15 @@ while [ $# -ne 0 ]; do esac done -dirs=$@ -if [ -z $dirs ]; then - dirs="." +# If positional arguments are zero length (== no directories given). +if [ -z $@ ]; then + # Then set $1 (and $@) to current directory. + set -- "." +fi + +# If stdin is a tty. +if [ -t 1 ]; then + echo "Checking $@" fi awk_script=' @@ -100,9 +107,4 @@ END { } ' -# If stdin is a tty. -if [ -t 1 ]; then - echo "Checking '$dirs'" -fi - -find $dirs -name citrun.log -print0 | xargs -0 awk "$awk_script" +find $@ -name citrun.log -print0 | xargs -0 awk "$awk_script"