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.

(cherry picked from commit 0b6b7c2004)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-02-28 23:32:20 -05:00
parent 494bf9d6d2
commit 0c4b94ed59
+5
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;
}