]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
undo changes to hello command
authorBVK Chaitanya <bvk.groups@gmail.com>
Sun, 18 Jul 2010 15:30:58 +0000 (21:00 +0530)
committerBVK Chaitanya <bvk.groups@gmail.com>
Sun, 18 Jul 2010 15:30:58 +0000 (21:00 +0530)
hello/hello.c

index 1189662918a0834024ad26e0b88a85073aa9941e..183ee7798837e4bccb6b855a90a8e871a9ae1558 100644 (file)
 #include <grub/extcmd.h>
 #include <grub/i18n.h>
 
-static struct grub_script *script;
-
 static grub_err_t
-grub_cmd_hello (grub_extcmd_context_t ctxt,
-               int argc, char **args __attribute__ ((unused)))
+grub_cmd_hello (grub_extcmd_context_t ctxt __attribute__ ((unused)),
+               int argc __attribute__ ((unused)),
+               char **args __attribute__ ((unused)))
 {
-  if (argc == 0 && script == 0)
-    grub_printf ("Hello World\n");
-
-  else if (argc == 0)
-    grub_script_execute (script);
-
-  else
-    {
-      if (! ctxt->script_params || ! ctxt->script_params[0])
-       return 1;
-
-      if (script)
-       grub_script_put (script);
-
-      script = grub_script_get (ctxt->script_params[0]);
-    }
-
+  grub_printf ("Hello World\n");
   return 0;
 }
 
@@ -56,16 +39,11 @@ static grub_extcmd_t cmd;
 
 GRUB_MOD_INIT(hello)
 {
-  cmd = grub_register_extcmd ("hello", grub_cmd_hello,
-                             GRUB_COMMAND_FLAG_BOTH | GRUB_COMMAND_FLAG_BLOCKS,
-                             N_("[BLOCK]"), N_("Say \"Hello World\"."), 0);
+  cmd = grub_register_extcmd ("hello", grub_cmd_hello, GRUB_COMMAND_FLAG_BOTH,
+                             0, N_("Say \"Hello World\"."), 0);
 }
 
 GRUB_MOD_FINI(hello)
 {
-  if (script)
-    grub_script_put (script);
-
-  script = 0;
   grub_unregister_extcmd (cmd);
 }