summaryrefslogtreecommitdiffstats
path: root/usr.bin/yacc
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-07-29 09:47:33 +0000
committerobrien <obrien@FreeBSD.org>1999-07-29 09:47:33 +0000
commitb10abbc3c0dc774658140663a50f71d22871396d (patch)
treee7f50f8dfbeb2a22e3298eba13d5a6a74b6dd7eb /usr.bin/yacc
parentecc95f8e7b45432bee66e7ceadb43a1ad6679cec (diff)
downloadFreeBSD-src-b10abbc3c0dc774658140663a50f71d22871396d.zip
FreeBSD-src-b10abbc3c0dc774658140663a50f71d22871396d.tar.gz
Check that user supplied the required argument; and if not, show usage().
Obtained from: OpenBSD
Diffstat (limited to 'usr.bin/yacc')
-rw-r--r--usr.bin/yacc/yyfix.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.bin/yacc/yyfix.sh b/usr.bin/yacc/yyfix.sh
index 29085f9..d983df6 100644
--- a/usr.bin/yacc/yyfix.sh
+++ b/usr.bin/yacc/yyfix.sh
@@ -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
OpenPOWER on IntegriCloud