diff options
author | Kay Sievers <kay@vrfy.org> | 2013-03-05 19:32:36 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-03-05 19:34:38 +0100 |
commit | 2f2343c6b15ec5495eb5032ae36b937fe36177cc (patch) | |
tree | 5a1e38074e55f2ad57ee06d4bea1a65668f4ee26 | |
parent | 1a9ce3f766a03c7daab4ca7edae7533841e1721a (diff) |
inhibit: print --list if no argument is given
-rw-r--r-- | src/login/inhibit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/login/inhibit.c b/src/login/inhibit.c index 586582190e..a812195cae 100644 --- a/src/login/inhibit.c +++ b/src/login/inhibit.c @@ -230,7 +230,10 @@ static int parse_argv(int argc, char *argv[]) { } } - if (arg_action == ACTION_INHIBIT && optind >= argc) { + if (arg_action == ACTION_INHIBIT && argc == 1) + arg_action = ACTION_LIST; + + else if (arg_action == ACTION_INHIBIT && optind >= argc) { log_error("Missing command line to execute."); return -EINVAL; } |