chiark / gitweb /
inhibit: print --list if no argument is given
authorKay Sievers <kay@vrfy.org>
Tue, 5 Mar 2013 18:32:36 +0000 (19:32 +0100)
committerKay Sievers <kay@vrfy.org>
Tue, 5 Mar 2013 18:34:38 +0000 (19:34 +0100)
src/login/inhibit.c

index 5865821..a812195 100644 (file)
@@ -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;
         }