Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JJ6Ea-00075o-8I for mharc-grub-devel@gnu.org; Sun, 27 Jan 2008 07:03:36 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JJ6EY-00073T-Fd for grub-devel@gnu.org; Sun, 27 Jan 2008 07:03:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JJ6EW-00071m-3N for grub-devel@gnu.org; Sun, 27 Jan 2008 07:03:34 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJ6EV-00071d-Ry for grub-devel@gnu.org; Sun, 27 Jan 2008 07:03:31 -0500 Received: from smtp8-g19.free.fr ([212.27.42.65]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JJ6EV-0003aJ-D2 for grub-devel@gnu.org; Sun, 27 Jan 2008 07:03:31 -0500 Received: from smtp8-g19.free.fr (localhost [127.0.0.1]) by smtp8-g19.free.fr (Postfix) with ESMTP id 55CF917F554 for ; Sun, 27 Jan 2008 12:59:46 +0100 (CET) Received: from [192.168.0.20] (klabs.be [82.224.65.140]) by smtp8-g19.free.fr (Postfix) with ESMTP id 26C0B17F52E for ; Sun, 27 Jan 2008 12:59:46 +0100 (CET) From: Franklin PIAT To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="=-Ckq1nhpS8O1Q+fAYr1si" Date: Sun, 27 Jan 2008 12:59:46 +0100 Message-Id: <1201435186.6329.128.camel@solid.paris.klabs.be> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [PATCH] update-grub --help options X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2008 12:03:34 -0000 --=-Ckq1nhpS8O1Q+fAYr1si Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, I've noticed that update-grub doesn't handle usual options (especially -h and --help). Here's a patch that fix it. (it also remove a blank space in #!/bin/sh header) Franklin --=-Ckq1nhpS8O1Q+fAYr1si Content-Disposition: attachment; filename=update-grub.diff Content-Type: text/x-patch; name=update-grub.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit --- update-grub.orig 2008-01-27 12:49:41.000000000 +0100 +++ update-grub.new 2008-01-27 12:56:10.000000000 +0100 @@ -1,5 +1,4 @@ -#! /bin/sh -e - +#!/bin/sh -e # Generate grub.cfg by inspecting /boot contents. # Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. # @@ -22,6 +21,9 @@ exec_prefix=@exec_prefix@ sbindir=@sbindir@ libdir=@libdir@ +PACKAGE_NAME=@PACKAGE_NAME@ +PACKAGE_TARNAME=@PACKAGE_TARNAME@ +PACKAGE_VERSION=@PACKAGE_VERSION@ sysconfdir=@sysconfdir@ grub_prefix=`echo /boot/grub | sed ${transform}` grub_cfg=${grub_prefix}/grub.cfg @@ -34,6 +36,47 @@ # for convert_system_path_to_grub_path(), font_path() . ${libdir}/grub/update-grub_lib +# Usage: usage +# Print the usage. +usage () { + cat <. +EOF +} + +# Check the arguments. +for option in "$@"; do + case "$option" in + -h | --help) + usage + exit 0 ;; + -v | --version) + echo "update-grub (GNU GRUB ${PACKAGE_VERSION})" + exit 0 ;; + -y) + echo "$0: warning: Ignoring -y option (no longer needed)." >&2 + -*) + echo "$0: warning: Unrecognized option \`$option'" 1>&2 + usage + exit 1 + ;; + *) + echo "$0: warning: Unexpected argument \`$option'" 1>&2 + usage + exit 1 + esac +done + if [ "x$UID" = "x" ] ; then UID=`id -u` fi @@ -43,10 +86,6 @@ exit 1 fi -if [ "$1" = "-y" ] ; then - echo "$0: warning: Ignoring -y option (no longer needed)." >&2 -fi - set $grub_mkdevicemap dummy if test -f "$1"; then : --=-Ckq1nhpS8O1Q+fAYr1si--