2009-10-26 Colin Watson <cjwatson@ubuntu.com>
* 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.
This commit is contained in:
parent
e4f6809bbc
commit
9031b03aac
2 changed files with 18 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2009-10-26 Colin Watson <cjwatson@ubuntu.com>
|
||||||
|
|
||||||
|
* 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 <cjwatson@ubuntu.com>
|
2009-10-26 Colin Watson <cjwatson@ubuntu.com>
|
||||||
|
|
||||||
Improve grub-mkconfig performance when there are several menu
|
Improve grub-mkconfig performance when there are several menu
|
||||||
|
|
|
@ -72,7 +72,7 @@ usage (int status)
|
||||||
fprintf (stderr, "Try ``grub-editenv --help'' for more information.\n");
|
fprintf (stderr, "Try ``grub-editenv --help'' for more information.\n");
|
||||||
else
|
else
|
||||||
printf ("\
|
printf ("\
|
||||||
Usage: grub-editenv [OPTIONS] FILENAME COMMAND\n\
|
Usage: grub-editenv [OPTIONS] [FILENAME] COMMAND\n\
|
||||||
\n\
|
\n\
|
||||||
Tool to edit environment block.\n\
|
Tool to edit environment block.\n\
|
||||||
\nCommands:\n\
|
\nCommands:\n\
|
||||||
|
@ -85,7 +85,10 @@ Tool to edit environment block.\n\
|
||||||
-V, --version print version information and exit\n\
|
-V, --version print version information and exit\n\
|
||||||
-v, --verbose print verbose messages\n\
|
-v, --verbose print verbose messages\n\
|
||||||
\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);
|
exit (status);
|
||||||
}
|
}
|
||||||
|
@ -288,12 +291,14 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
if (optind + 1 >= argc)
|
if (optind + 1 >= argc)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "no command specified\n");
|
filename = DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG;
|
||||||
usage (1);
|
command = argv[optind];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
filename = argv[optind];
|
filename = argv[optind];
|
||||||
command = argv[optind + 1];
|
command = argv[optind + 1];
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp (command, "create") == 0)
|
if (strcmp (command, "create") == 0)
|
||||||
create_envblk_file (filename);
|
create_envblk_file (filename);
|
||||||
|
|
Loading…
Add table
Reference in a new issue