diff options
author | Bruno Haible <bruno@clisp.org> | 2007-09-08 22:45:08 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2007-09-08 22:45:08 +0000 |
commit | bd36c1c7cf781b78b64a0d9436aec83af95cd537 (patch) | |
tree | 150377c17e3d7e37841e3b68b794ab7f79e05c81 /posix-modules | |
parent | 3f1fb31baf59beafb7faa9767d7ec8cb0e8fcdbe (diff) | |
download | gnulib-bd36c1c7cf781b78b64a0d9436aec83af95cd537.tar.gz |
Add --help and --version option processing.
Diffstat (limited to 'posix-modules')
-rwxr-xr-x | posix-modules | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/posix-modules b/posix-modules index 54d68ca95a..21aa8bebf5 100755 --- a/posix-modules +++ b/posix-modules @@ -19,7 +19,7 @@ progname=$0 package=gnulib -cvsdatestamp='$Date: 2007-09-08 22:27:19 $' +cvsdatestamp='$Date: 2007-09-08 22:45:08 $' last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` @@ -117,6 +117,26 @@ while test -h "$self_abspathname"; do done gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'` +# Command-line option processing. +while test $# -gt 0; do + case "$1" in + --help | --hel | --he | --h ) + func_usage + exit $? ;; + --version | --versio | --versi | --vers | --ver | --ve | --v ) + func_version + exit $? ;; + -* ) + echo "posix-modules: unknown option $1" 1>&2 + echo "Try 'posix-modules --help' for more information." 1>&2 + exit 1 ;; + * ) + echo "posix-modules: too many arguments" 1>&2 + echo "Try 'posix-modules --help' for more information." 1>&2 + exit 1 ;; + esac +done + ( # Get the header modules. LC_ALL=C grep -h '^Gnulib module: ' "$gnulib_dir"/doc/headers/* 2>/dev/null \ |