diff options
Diffstat (limited to 'src/tty-ask-password-agent/tty-ask-password-agent.c')
-rw-r--r-- | src/tty-ask-password-agent/tty-ask-password-agent.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 94ae5670f7..528b899c08 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -588,8 +588,7 @@ finish: return r; } -static int help(void) { - +static void help(void) { printf("%s [OPTIONS...]\n\n" "Process system password requests.\n\n" " -h --help Show this help\n" @@ -601,8 +600,6 @@ static int help(void) { " --plymouth Ask question with Plymouth instead of on TTY\n" " --console Ask question on /dev/console instead of current TTY\n", program_invocation_short_name); - - return 0; } static int parse_argv(int argc, char *argv[]) { @@ -634,12 +631,13 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) { + while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) switch (c) { case 'h': - return help(); + help(); + return 0; case ARG_VERSION: puts(PACKAGE_STRING); @@ -676,10 +674,9 @@ static int parse_argv(int argc, char *argv[]) { default: assert_not_reached("Unhandled option"); } - } if (optind != argc) { - help(); + log_error("%s takes no arguments.", program_invocation_short_name); return -EINVAL; } |