* util/ieee1275/grub-ofpathname.c (main): Handle --help and --version

so that help2man doesn't fail.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-06-27 12:16:00 +02:00
parent b6f945dccb
commit b28c56559b
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2011-06-27 Vladimir Serbinenko <phcoder@gmail.com>
* util/ieee1275/grub-ofpathname.c (main): Handle --help and --version
so that help2man doesn't fail.
2011-06-27 Vladimir Serbinenko <phcoder@gmail.com> 2011-06-27 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/net/drivers/ieee1275/ofnet.c (send_card_buffer) Use right * grub-core/net/drivers/ieee1275/ofnet.c (send_card_buffer) Use right

View file

@ -32,11 +32,16 @@ int main(int argc, char **argv)
grub_util_init_nls (); grub_util_init_nls ();
if (argc != 2) if (argc != 2 || strcmp (argv[1], "--help") == 0)
{ {
printf("Usage: %s DEVICE\n", program_name); printf("Usage: %s DEVICE\n", program_name);
return 1; return 1;
} }
if (strcmp (argv[1], "--version") == 0)
{
printf ("%s\n", PACKAGE_STRING);
return 1;
}
of_path = grub_util_devname_to_ofpath (argv[1]); of_path = grub_util_devname_to_ofpath (argv[1]);
printf("%s\n", of_path); printf("%s\n", of_path);