summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkinitcpio8
1 files changed, 7 insertions, 1 deletions
diff --git a/mkinitcpio b/mkinitcpio
index 9b85fab..fb53086 100644
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -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