diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-06-18 20:23:39 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-06-18 20:23:39 +0200 |
commit | 442b90946ac317da602aef916a7bac29437368b2 (patch) | |
tree | 4340a0d44019ac0d013f07a3de8ec340d729eb65 | |
parent | e4a9373fb3ddeadd6b847449186fadf5963695f7 (diff) |
systemctl: when called as shutdown, fail if first argument isn't 'now'
-rw-r--r-- | src/systemctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/systemctl.c b/src/systemctl.c index 68e4a909eb..6a7a9bdd6d 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -1465,7 +1465,7 @@ static int halt_help(void) { static int shutdown_help(void) { - printf("%s [options] [IGNORED] [WALL...]\n\n" + printf("%s [options] [now] [WALL...]\n\n" "Shut down the system.\n\n" " --help Show this help\n" " -H --halt Halt the machine\n" @@ -1741,6 +1741,11 @@ static int shutdown_parse_argv(int argc, char *argv[]) { } } + if (argc > optind && !streq(argv[optind], "now")) { + log_error("Expected 'now' argument."); + return -EINVAL; + } + /* We ignore the time argument */ if (argc > optind + 1) arg_wall = argv + optind + 1; |