From: Tong Sun Date: Fri, 17 Oct 2008 20:08:50 +0000 (-0400) Subject: Handle the unrecognized options for getopt X-Git-Tag: v0.23~17^2~7 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=73f5513fb3a7327532a9bbc73e97560a5da1bd5f;hp=d6f0f6fda6c1ed1b71629ee305e3daa16708d21b Handle the unrecognized options for getopt stop on unrecognized options instead of ignoring them --- diff --git a/grml-debootstrap.clp b/grml-debootstrap.clp index f3b4a78..40063cb 100644 --- a/grml-debootstrap.clp +++ b/grml-debootstrap.clp @@ -7,7 +7,7 @@ # grml # # @Author: Tong SUN -# @Release: $Revision: 1.1 $, under the BSD license +# @Release: $Revision: 1.2 $, under the BSD license # @HomeURL: http://xpt.sourceforge.net/ # @@ -19,10 +19,13 @@ -eval set -- `getopt \ - -o +m:i:r:t:p:c:hv --long \ +_opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:c:hv --long \ mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,config:,packages::,debconf::,keep_src_list,hostname:,password:,bootappend:,groot:,grub:,help,version \ -- "$@"` +if [ $? != 0 ]; then + eerror "Try `grml-debootstrap --help' for more information."; eend 1; exit 1 +fi +eval set -- "$_opt_temp" while :; do case "$1" in