X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fboot%2Fbootctl.c;h=359e273fd9f6d9731aca147d4f0ba7b3f0d09e59;hb=ce0f1493c399178a3c7796415bfe5abd105ad610;hp=af694fdf64adff9393b02391c04b5ac5c901d4f3;hpb=8b3227c90d20eaa834bd5efc68007cf6b20fbdbb;p=elogind.git diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index af694fdf6..359e273fd 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -33,8 +33,9 @@ #include "utf8.h" static int help(void) { + printf("%s [OPTIONS...] COMMAND ...\n\n" - "Query or change firmware and boot mananger settings.\n\n" + "Query or change firmware and boot manager settings.\n\n" " -h --help Show this help\n" " --version Show package version\n" "Commands:\n" @@ -52,20 +53,20 @@ static int parse_argv(int argc, char *argv[]) { static const struct option options[] = { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, ARG_VERSION }, - { NULL, 0, NULL, 0 } + {} }; int c; assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "+hH:P", options, NULL)) >= 0) { + + while ((c = getopt_long(argc, argv, "+h", options, NULL)) >= 0) { switch (c) { case 'h': - help(); - return 0; + return help(); case ARG_VERSION: puts(PACKAGE_STRING); @@ -76,8 +77,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - log_error("Unknown option code %c", c); - return -EINVAL; + assert_not_reached("Unhandled option"); } }