Skip to contentSkip to conversation

hide `Try 'help' for usage' if help doestn't exist in rescue mode

PATCH In review Felix Zielcke 2 participants 3 messages Sep 6, 2009 – Sep 8, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hide `Try 'help' for usage' if help doestn't exist in rescue mode

I think we shouldn't tell users to type `help' if the command doestn't exist in rescue mode, i.e. minicmd isn't included in core.img This increases the size of kernel.img for me by 28 bytes. I think it's worth.

It's so small I don't bother to attach it:

2009-09-06 Felix Zielcke <[email protected]>

* kern/rescue_parser.c (grub_rescue_parse_line): Only suggest to try `help' if the command exists.

kern/rescue_parser.c +2 -1
index 79f32b8..1e0841e 100644
@@ -61,7 +61,8 @@ grub_rescue_parse_line (char *line, grub_reader_getline_t getline)
   else
     {
       grub_printf ("Unknown command `%s'\n", name);
-      grub_printf ("Try `help' for usage\n");
+      if (grub_command_find ("help"))
+	grub_printf ("Try `help' for usage\n");
     }
 
  quit:
Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer
#1 lore raw
Quoted 17 lines · Felix Zielcke

I think we shouldn't tell users to type `help' if the command doestn't exist in rescue mode, i.e. minicmd isn't included in core.img This increases the size of kernel.img for me by 28 bytes. I think it's worth.

It's so small I don't bother to attach it:

2009-09-06 Felix Zielcke <[email protected]>

* kern/rescue_parser.c (grub_rescue_parse_line): Only suggest to try `help' if the command exists.

kern/rescue_parser.c +0 -0
index 79f32b8..1e0841e 100644

kern/rescue_parser.c grub_rescue_parse_line (char *line, grub_reader_getline_t getline) · line 68

Quoted 9 lines
kern/rescue_parser.c +2 -1
@@ -61,7 +61,8 @@ grub_rescue_parse_line (char *line, grub_reader_getline_t getline)
   else
     {
       grub_printf ("Unknown command `%s'\n", name);
-      grub_printf ("Try `help' for usage\n");
+      if (grub_command_find ("help"))
+	grub_printf ("Try `help' for usage\n");
     }
 
  quit:

Seems fine.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#2 lore raw

Am Dienstag, den 08.09.2009, 16:49 +0200 schrieb Robert Millan:

Quoted 26 lines · Felix Zielcke
Quoted 25 lines

I think we shouldn't tell users to type `help' if the command doestn't exist in rescue mode, i.e. minicmd isn't included in core.img This increases the size of kernel.img for me by 28 bytes. I think it's worth.

It's so small I don't bother to attach it:

2009-09-06 Felix Zielcke <[email protected]>

* kern/rescue_parser.c (grub_rescue_parse_line): Only suggest to try `help' if the command exists.

kern/rescue_parser.c +2 -1
index 79f32b8..1e0841e 100644
@@ -61,7 +61,8 @@ grub_rescue_parse_line (char *line, grub_reader_getline_t getline)
   else
     {
       grub_printf ("Unknown command `%s'\n", name);
-      grub_printf ("Try `help' for usage\n");
+      if (grub_command_find ("help"))
+	grub_printf ("Try `help' for usage\n");
     }
 
Quoted 4 lines

kern/rescue_parser.c grub_rescue_parse_line (char *line, grub_reader_getline_t getline) · line 68

Quoted 1 line
kern/rescue_parser.c +0 -0
  quit:

Seems fine.

Ok thanks. Commited.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer