mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-04 07:48:36 +00:00
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:
@@ -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