Commit 7f167be6 by Tom de Vries Committed by Tom de Vries

check_GNU_style.sh: Read either from stdin, or from files

2015-05-12  Tom de Vries  <tom@codesourcery.com>

	* check_GNU_style.sh: Read either from stdin, or from files.

From-SVN: r223086
parent 0648b807
2015-05-12 Tom de Vries <tom@codesourcery.com>
* check_GNU_style.sh: Read either from stdin, or from files.
2015-05-12 Tom de Vries <tom@codesourcery.com>
* check_GNU_style.sh: Check if files exists.
2015-05-12 Tom de Vries <tom@codesourcery.com>
......
......@@ -39,12 +39,22 @@ test $# -eq 0 && usage
nfiles=$#
files="$*"
for f in $files; do
if [ "$f" != "-" ] && [ ! -f "$f" ]; then
echo "error: could not read file: $f"
exit 1
fi
done
stdin=false
if [ $nfiles -eq 1 ] && [ "$files" = "-" ]; then
stdin=true
else
for f in $files; do
if [ "$f" = "-" ]; then
# Let's keep things simple. Either we read from stdin, or we read
# from files specified on the command line, not both.
usage
fi
if [ ! -f "$f" ]; then
echo "error: could not read file: $f"
exit 1
fi
done
fi
inp=check_GNU_style.inp
tmp=check_GNU_style.tmp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment