From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OFRCp-0002HQ-IM for mharc-grub-devel@gnu.org; Fri, 21 May 2010 08:19:59 -0400 Received: from [140.186.70.92] (port=40060 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFRCl-0002Fz-Ml for grub-devel@gnu.org; Fri, 21 May 2010 08:19:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFRCj-0001GB-Q9 for grub-devel@gnu.org; Fri, 21 May 2010 08:19:55 -0400 Received: from mail-ww0-f41.google.com ([74.125.82.41]:55616) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFRCj-0001Ft-KV for grub-devel@gnu.org; Fri, 21 May 2010 08:19:53 -0400 Received: by wwi14 with SMTP id 14so670039wwi.0 for ; Fri, 21 May 2010 05:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=2wc24qW4wJOxv87oU2CoOytRvSrSQnJJKVVnVnvB1bk=; b=KchE9fqBcBgg+WMlEvBOfobkalpmHMWJFyuiqyeNFsNKDMylnRHAAKw0gaxaycf83M ea9M1UM7wusI/vzxdveAPdE7OvmzYlSweI4FaA5g0WH90Cnl3dqnVf7E2w8aF66/9la7 hyiM3SE6v1ZsxDNdIrI0vux7dMdWNIuR9VaOA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=hbaVhWR/2/3WUkdUPNqo7pf4zUtk5SOcXCjh3lcIrdqmGSQ6D7Er8OqekZAyCvdCDA 8XoKGO4buSn/SJEPmGHKqn3J03iMBP0UExTc8rNnVjh2bc2Yqr8BoprMtocUGUyQTN+M DxSlQ2WBTVkJOjvs+f1dHfKhPHbLtAXuz5EHo= Received: by 10.216.171.85 with SMTP id q63mr786368wel.143.1274444391895; Fri, 21 May 2010 05:19:51 -0700 (PDT) Received: from [192.168.1.50] (c2433-1-88-160-112-182.fbx.proxad.net [88.160.112.182]) by mx.google.com with ESMTPS id e82sm431635wej.4.2010.05.21.05.19.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 21 May 2010 05:19:51 -0700 (PDT) Message-ID: <4BF67A58.5070702@gmail.com> Date: Fri, 21 May 2010 14:19:36 +0200 From: =?ISO-8859-1?Q?Gr=E9goire_Sutre?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100411 Icedove/3.0.4 MIME-Version: 1.0 To: The development of GNU GRUB References: <4BF65BB0.6010303@gmail.com> <20100521105714.GD21862@riva.ucam.org> In-Reply-To: <20100521105714.GD21862@riva.ucam.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Option handling in grub-mkconfig X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2010 12:19:56 -0000 On 05/21/2010 12:57 PM, Colin Watson wrote: Thanks for the patch, it works fine. I'm just wondering: Is keeping `-o' worth the extra complication? Grégoire > How about: > > === modified file 'util/grub-mkconfig.in' > --- util/grub-mkconfig.in 2010-04-19 19:25:41 +0000 > +++ util/grub-mkconfig.in 2010-05-21 10:54:18 +0000 > @@ -50,7 +50,13 @@ EOF > } > > # Check the arguments. > +next_grub_cfg=false > for option in "$@"; do > + if $next_grub_cfg; then > + grub_cfg=$option > + next_grub_cfg=false > + continue > + fi > case "$option" in > -h | --help) > usage > @@ -59,8 +65,7 @@ for option in "$@"; do > echo "$0 (GNU GRUB ${package_version})" > exit 0 ;; > -o) > - shift > - grub_cfg=$1 > + next_grub_cfg=: > ;; > --output=*) > grub_cfg=`echo "$option" | sed 's/--output=//'` > @@ -72,6 +77,11 @@ for option in "$@"; do > ;; > esac > done > +if $next_grub_cfg; then > + echo "Missing argument to \`-o'" 1>&2 > + usage > + exit 1 > +fi > > . ${libdir}/grub/grub-mkconfig_lib > >