inhibit: print --list if no argument is given

This commit is contained in:
Kay Sievers 2013-03-05 19:32:36 +01:00
parent 1a9ce3f766
commit 2f2343c6b1

View 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;
}