diff options
author | Aaron Griffin <aaron@archlinux.org> | 2006-06-16 18:25:29 +0200 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-06-16 18:25:29 +0200 |
commit | f915839219cadde8cba5e286df51a6a8de404149 (patch) | |
tree | e0202009ab624d650ba9adf1eb9d9947da365073 | |
parent | c3115e19e9874dc0e193bf82ef671f5f879321a6 (diff) | |
download | mkinitcpio-f915839219cadde8cba5e286df51a6a8de404149.tar.gz mkinitcpio-f915839219cadde8cba5e286df51a6a8de404149.tar.xz |
Fixed optarg picking up other options...
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@129 880c04e9-e011-0410-abf7-b926e227c9cd
-rw-r--r-- | mkinitcpio | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -47,7 +47,12 @@ usage () exit 1 } -while getopts 'c:k:s:b:g:a:vH:LMh' arg; do +while getopts ':c:k:s:b:g:a:vH:LMh' arg; do + if [ "${OPTARG:0:1}" = "-" ]; then + echo "error: optional argument to '-$arg' begins with a '-'" + echo " you probably don't want this....aborting." + usage + fi case "$arg" in c) CONFIG="$OPTARG" ;; k) KERNELVERSION="$OPTARG" ;; @@ -67,6 +72,7 @@ while getopts 'c:k:s:b:g:a:vH:LMh' arg; do exit 0 ;; M) SHOW_AUTOMODS="y" ;; h|?) usage ;; + :) echo "${OPTARG} requires a value..."; usage ;; *) echo "invalid argument '$arg'"; usage ;; esac done |