grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] parttool


From: phcoder
Subject: Re: [PATCH] parttool
Date: Wed, 08 Apr 2009 11:35:08 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090318)

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
diff --git a/ChangeLog b/ChangeLog
index c679982..20c1804 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-08  Vladimir Serbinenko  <address@hidden>
+       
+       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  <address@hidden>
 
        * 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 via email to

[Prev in Thread] Current Thread [Next in Thread]