All of lore.kernel.org
 help / color / mirror / Atom feed
From: phcoder <phcoder@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] parttool
Date: Wed, 08 Apr 2009 11:35:08 +0200	[thread overview]
Message-ID: <49DC6FCC.2020909@gmail.com> (raw)
In-Reply-To: <1239035609.8986.42.camel@mj>

[-- Attachment #1: Type: text/plain, Size: 590 bytes --]

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 <partition> 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

[-- Attachment #2: parttoolhelp.diff --]
[-- Type: text/x-diff, Size: 1700 bytes --]

diff --git a/ChangeLog b/ChangeLog
index c679982..20c1804 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-08  Vladimir Serbinenko  <phcoder@gmail.com>
+	
+	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  <davem@davemloft.net>
 
 	* 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)

  reply	other threads:[~2009-04-08  9:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 21:15 [PATCH] parttool phcoder
2009-03-10 17:45 ` phcoder
2009-03-20 19:33   ` phcoder
2009-04-04  9:22     ` phcoder
2009-04-05 14:48       ` Yoshinori K. Okuji
2009-04-06  9:52         ` phcoder
2009-04-06 15:53           ` Pavel Roskin
2009-04-06 15:56             ` phcoder
2009-04-06 16:20               ` Pavel Roskin
2009-04-06 16:25                 ` phcoder
2009-04-06 16:33                   ` Pavel Roskin
2009-04-08  9:35                     ` phcoder [this message]
2009-04-08 20:24                       ` Pavel Roskin
2009-04-17 11:12                         ` phcoder
2009-04-25 12:21                           ` Vladimir Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49DC6FCC.2020909@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.