summaryrefslogtreecommitdiff
path: root/src/login/inhibit.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-03-05 19:32:36 +0100
committerKay Sievers <kay@vrfy.org>2013-03-05 19:34:38 +0100
commit2f2343c6b15ec5495eb5032ae36b937fe36177cc (patch)
tree5a1e38074e55f2ad57ee06d4bea1a65668f4ee26 /src/login/inhibit.c
parent1a9ce3f766a03c7daab4ca7edae7533841e1721a (diff)
inhibit: print --list if no argument is given
Diffstat (limited to 'src/login/inhibit.c')
-rw-r--r--src/login/inhibit.c5
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;
}