commit-grub
[Top][All Lists]
Advanced

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

[2659] 2009-10-26 Colin Watson <address@hidden>


From: Colin Watson
Subject: [2659] 2009-10-26 Colin Watson <address@hidden>
Date: Mon, 26 Oct 2009 16:33:15 +0000

Revision: 2659
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2659
Author:   cjwatson
Date:     2009-10-26 16:33:13 +0000 (Mon, 26 Oct 2009)
Log Message:
-----------
2009-10-26  Colin Watson  <address@hidden>

        * util/grub-editenv.c (main): If only a command is given, use
        DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG as a default file name.
        (usage): FILENAME is now optional and has a default.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/util/grub-editenv.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog       2009-10-26 16:28:04 UTC (rev 2658)
+++ trunk/grub2/ChangeLog       2009-10-26 16:33:13 UTC (rev 2659)
@@ -1,5 +1,11 @@
 2009-10-26  Colin Watson  <address@hidden>
 
+       * util/grub-editenv.c (main): If only a command is given, use
+       DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG as a default file name.
+       (usage): FILENAME is now optional and has a default.
+
+2009-10-26  Colin Watson  <address@hidden>
+
        Improve grub-mkconfig performance when there are several menu
        entries on a single filesystem.
 

Modified: trunk/grub2/util/grub-editenv.c
===================================================================
--- trunk/grub2/util/grub-editenv.c     2009-10-26 16:28:04 UTC (rev 2658)
+++ trunk/grub2/util/grub-editenv.c     2009-10-26 16:33:13 UTC (rev 2659)
@@ -72,7 +72,7 @@
     fprintf (stderr, "Try ``grub-editenv --help'' for more information.\n");
   else
     printf ("\
-Usage: grub-editenv [OPTIONS] FILENAME COMMAND\n\
+Usage: grub-editenv [OPTIONS] [FILENAME] COMMAND\n\
 \n\
 Tool to edit environment block.\n\
 \nCommands:\n\
@@ -85,7 +85,10 @@
   -V, --version             print version information and exit\n\
   -v, --verbose             print verbose messages\n\
 \n\
-Report bugs to <%s>.\n", PACKAGE_BUGREPORT);
+If not given explicitly, FILENAME defaults to %s.\n\
+\n\
+Report bugs to <%s>.\n",
+DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG, PACKAGE_BUGREPORT);
 
   exit (status);
 }
@@ -288,13 +291,15 @@
 
   if (optind + 1 >= argc)
     {
-      fprintf (stderr, "no command specified\n");
-      usage (1);
+      filename = DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG;
+      command = argv[optind];
     }
+  else
+    {
+      filename = argv[optind];
+      command = argv[optind + 1];
+    }
 
-  filename = argv[optind];
-  command = argv[optind + 1];
-
   if (strcmp (command, "create") == 0)
     create_envblk_file (filename);
   else if (strcmp (command, "list") == 0)





reply via email to

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