aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/yacc/yyfix.sh
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1999-07-29 09:47:33 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1999-07-29 09:47:33 +0000
commit6db03527ff55ce30ecfdb111ddecd5ccb92664e3 (patch)
treee340534cefebc3092d71bf73d626dc4976f433f7 /usr.bin/yacc/yyfix.sh
parente7bd01e5df8a3e8b4c1159aff8d4842b82dfc606 (diff)
downloadsrc-6db03527ff55ce30ecfdb111ddecd5ccb92664e3.tar.gz
src-6db03527ff55ce30ecfdb111ddecd5ccb92664e3.zip
Check that user supplied the required argument; and if not, show usage().
Obtained from: OpenBSD
Notes
Notes: svn path=/head/; revision=49212
Diffstat (limited to 'usr.bin/yacc/yyfix.sh')
-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 29085f9861f3..d983df678e7f 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