Check that user supplied the required argument; and if not, show usage().

Obtained from:	OpenBSD
This commit is contained in:
obrien 1999-07-29 09:47:33 +00:00
parent 5917e51054
commit 596e3f565c

View File

@ -37,6 +37,11 @@ OLDYACC="yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef"
NEWYACC="yylhs yylen yydefred yydgoto yysindex yyrindex yygindex \
yytable yycheck"
if [ $# -eq 0 ]; then
echo "usage: $0 file [tables]" >&2
exit 1
fi
file=$1
>$file
shift