From 242af28e62f4eec88561022789f943aaed55ef06 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 12 Nov 1995 23:35:53 +0000 Subject: [PATCH] Bug fixes to argument parsing code. --- automake.in | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/automake.in b/automake.in index 5513f139..0b3e729b 100755 --- a/automake.in +++ b/automake.in @@ -31,10 +31,9 @@ usage="Usage: automake [--help] [--version] Makefile..." if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi -mlist= -for -do - case "$arg" in +mfiles= +while test $# -gt 0; do + case "$1" in --help | --h* ) echo "${usage}" 1>&2 exit 0 @@ -44,15 +43,33 @@ do echo "Automake version $VERSION" exit 0 ;; + + -- ) # Stop option processing. + shift + break + ;; + + -*) + # FIXME consider "-" meaning stdin as input? + echo "automake: unrecognized option -- \`$1'" 1>&2 + echo "${usage}" 1>&2 + exit 1 + ;; + + * ) + mfiles="$mfiles $arg" + ;; esac + shift done # FIXME in this case, should look for Makefile.am, */Makefile.am and # use those. -if test $# -eq 0; then +if test ${#mfiles} -eq 0; then echo "${usage}" 1>&2 exit 1 fi +set $mfiles am_status=0 -- 2.43.5