From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LrUBh-0003iP-0e for mharc-grub-devel@gnu.org; Wed, 08 Apr 2009 05:35:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LrUBd-0003hr-Ja for grub-devel@gnu.org; Wed, 08 Apr 2009 05:35:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LrUBY-0003h7-Nx for grub-devel@gnu.org; Wed, 08 Apr 2009 05:35:12 -0400 Received: from [199.232.76.173] (port=49363 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LrUBY-0003h2-Gw for grub-devel@gnu.org; Wed, 08 Apr 2009 05:35:08 -0400 Received: from mail-bw0-f167.google.com ([209.85.218.167]:43996) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LrUBX-0008Nr-V5 for grub-devel@gnu.org; Wed, 08 Apr 2009 05:35:08 -0400 Received: by bwz11 with SMTP id 11so29583bwz.42 for ; Wed, 08 Apr 2009 02:35:06 -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; bh=0lKrIqPSt6m40chvx4wKsjKkfqVwPgA24RPlDDhdTio=; b=n7SMyGnNK4NlE+N831oYgqTAiYatObyzlP0saj+n6Kqt0hb8SjhSIRFPepA4MWiZG5 MS3qqyBI3CNzodAUyU67FXqGwBqWo8HxgSWki+LJBMlyqjQw/mqK+wx6xa5lBFUah3jS d6g51whketmgcVZb7lotOZvnorlxC5vH+iRGU= 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; b=WBr+lD5LUvN2QwUzvjICmZdUS5uomgXpJ+IZa4p3eVGRSYwkq4WmwgfzsH1Iib08w4 diRvXefeCOvMeH01Uc4V6FNyyEMrOrezvMH0uY089iMQcTKQ8gyGiOMHaD01sKYEZzWd X4jkQS2Fw86sxYENyrlBodHIrNm2ypZ2Bg378= Received: by 10.103.248.17 with SMTP id a17mr441444mus.83.1239183306842; Wed, 08 Apr 2009 02:35:06 -0700 (PDT) Received: from ?82.130.80.138? (hg-public-dock-138-dhcp.ethz.ch [82.130.80.138]) by mx.google.com with ESMTPS id y6sm11371075mug.57.2009.04.08.02.35.05 (version=SSLv3 cipher=RC4-MD5); Wed, 08 Apr 2009 02:35:05 -0700 (PDT) Message-ID: <49DC6FCC.2020909@gmail.com> Date: Wed, 08 Apr 2009 11:35:08 +0200 From: phcoder User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: The development of GRUB 2 References: <49AEEF72.5050000@gmail.com> <49C3EF85.5080908@gmail.com> <49D726DF.4010601@gmail.com> <200904052348.15540.okuji@enbug.org> <49D9D0E6.5090706@gmail.com> <1239033183.8986.30.camel@mj> <49DA263E.7060803@gmail.com> <1239034857.8986.36.camel@mj> <49DA2CEF.3050404@gmail.com> <1239035609.8986.42.camel@mj> In-Reply-To: <1239035609.8986.42.camel@mj> Content-Type: multipart/mixed; boundary="------------070807090203070903010201" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] parttool 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: Wed, 08 Apr 2009 09:35:14 -0000 This is a multi-part message in MIME format. --------------070807090203070903010201 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Is this what you mean? Pavel Roskin wrote: > On Mon, 2009-04-06 at 18:25 +0200, phcoder wrote: > >> The problem is that the exact available options depend on partition type >> so you have to specify >> parttool help >> Unfortunately for now you have to load the module pcpart.mod manually. >> I'll fix this problem by making parttool load the corresponding module >> automatically > > OK. And please put "parttool PARTITION help" in quotes and capitalize > sentences. It took me some time to understand what the help says. > -- Regards Vladimir 'phcoder' Serbinenko --------------070807090203070903010201 Content-Type: text/x-diff; name="parttoolhelp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="parttoolhelp.diff" diff --git a/ChangeLog b/ChangeLog index c679982..20c1804 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-04-08 Vladimir Serbinenko + + Parttool help message improvement + + * commands/parttool.c (helpmsg): new variable + (grub_cmd_parttool): output help if not enough arguments are supplied + (GRUB_MOD_INIT(parttool)): use helpmsg + 2009-04-07 David S. Miller * kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Add diff --git a/commands/parttool.c b/commands/parttool.c index 6eec13b..24bdcce 100644 --- a/commands/parttool.c +++ b/commands/parttool.c @@ -33,6 +33,10 @@ static struct grub_parttool *parts = 0; static int curhandle = 0; static grub_dl_t mymod; +static char helpmsg[] = + "perform COMMANDS on partition.\n" + "Use \"parttool PARTITION help\" for the list " + " of available commands"; int grub_parttool_register(const char *part_name, @@ -102,7 +106,10 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), grub_err_t err = GRUB_ERR_NONE; if (argc < 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "too few arguments"); + { + grub_printf ("%s\n", helpmsg); + return grub_error (GRUB_ERR_BAD_ARGUMENT, "too few arguments"); + } if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') { @@ -252,9 +259,7 @@ GRUB_MOD_INIT(parttool) mymod = mod; cmd = grub_register_command ("parttool", grub_cmd_parttool, "parttool PARTITION COMMANDS", - "perform COMMANDS on partition." - " use parttool PARTITION help for the list " - " of available commands"); + helpmsg); } GRUB_MOD_FINI(parttool) --------------070807090203070903010201--