From b10abbc3c0dc774658140663a50f71d22871396d Mon Sep 17 00:00:00 2001 From: obrien Date: Thu, 29 Jul 1999 09:47:33 +0000 Subject: Check that user supplied the required argument; and if not, show usage(). Obtained from: OpenBSD --- usr.bin/yacc/yyfix.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'usr.bin/yacc') 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 -- cgit v1.1