From: Tom Tromey Date: Sun, 12 Nov 1995 23:35:53 +0000 (+0000) Subject: Bug fixes to argument parsing code. X-Git-Tag: Release-0-25~363 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ba8ee1dbd90004e8d3f90b4318a01f405d9e16c;p=thirdparty%2Fautomake.git Bug fixes to argument parsing code. --- diff --git a/automake.in b/automake.in index 5513f1399..0b3e729b8 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