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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user