From 8594326ce24db6de841568c0ebcdbf203d4a885a Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 6 Jun 2011 19:33:20 -0400 Subject: mkinitcpio: remove cruft in getopts loop We shouldn't guess at what the user does and doesn't want, but rather verify after parsing that what we have is sane. Also, remove the default case label, as this will never be met. Signed-off-by: Dave Reisner --- mkinitcpio | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mkinitcpio b/mkinitcpio index bbd066d..7169cb9 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -92,11 +92,6 @@ get_kernver() { trap sighandler TERM INT while getopts ':c:k:sb:g:p:m:vH:LMhS:' arg; do - if [ "${OPTARG#-}" != "${OPTARG}" ]; 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) optkver=$OPTARG ;; @@ -126,7 +121,6 @@ while getopts ':c:k:sb:g:p:m:vH:LMhS:' arg; do M) SHOW_AUTOMODS=1 ;; h|?) usage ;; :) echo "${OPTARG} requires a value..."; usage ;; - *) echo "invalid argument '${arg}'"; usage ;; esac done shift $((${OPTIND} - 1)) -- cgit v1.2.3-24-g4f1b