journalctl: refuse extra arguments with --verify and similar

Positional arguments only make sense with the default action.
For other actions, complain instead of ignoring them silently.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2014-02-26 23:01:43 -05:00
parent 47d80904a1
commit 0b6b7c2004
Notes: Zbigniew Jędrzejewski-Szmek 2014-02-27 23:27:35 -05:00
Backport: bugfix

View file

@ -658,6 +658,11 @@ static int parse_argv(int argc, char *argv[]) {
return -EINVAL;
}
if (arg_action != ACTION_SHOW && optind < argc) {
log_error("Extraneous arguments starting with '%s'", argv[optind]);
return -EINVAL;
}
return 1;
}