X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fnotify.c;h=1c18c6bc0805c449f190e4c89980e637cd45fde7;hp=77978104a71cd9f8789927e8a757606791e14161;hb=c88e7f4e57fcef7998dcd570e8a8866c5116f0de;hpb=96551bae6107936a4576b9b4b391abbc9963bdfe diff --git a/src/notify.c b/src/notify.c index 77978104a..1c18c6bc0 100644 --- a/src/notify.c +++ b/src/notify.c @@ -1,4 +1,4 @@ -/*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** This file is part of systemd. @@ -39,7 +39,7 @@ static bool arg_booted = false; static int help(void) { - printf("%s [options] [VARIABLE=VALUE...]\n\n" + printf("%s [OPTIONS...] [VARIABLE=VALUE...]\n\n" "Notify the init system about service status updates.\n\n" " -h --help Show this help\n" " --ready Inform the init system about service start-up completion\n" @@ -115,6 +115,15 @@ static int parse_argv(int argc, char *argv[]) { } } + if (optind >= argc && + !arg_ready && + !arg_status && + !arg_pid && + !arg_booted) { + help(); + return -EINVAL; + } + return 1; } @@ -125,6 +134,7 @@ int main(int argc, char* argv[]) { int r, retval = 1; log_parse_environment(); + log_open(); if ((r = parse_argv(argc, argv)) <= 0) { retval = r < 0;