udevadm-settle: reject positional arguments
The settle command does not define positional arguments.
Reject them during argument parsing instead of silently ignoring
them.
Reproducer:
udevadm settle /no/such/argument
Before:
The command exits successfully and ignores the argument.
Follow-up:
c71509028f
This commit is contained in:
@@ -88,6 +88,10 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
opts.opt->short_code);
|
||||
}
|
||||
|
||||
if (option_parser_get_n_args(&opts) > 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"This subprogram takes no positional arguments.");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ udevadm monitor -h
|
||||
udevadm settle
|
||||
udevadm settle -t 5
|
||||
udevadm settle -E /sys/class/net/$netdev
|
||||
(! udevadm settle /no/such/argument)
|
||||
udevadm settle -h
|
||||
|
||||
udevadm test /dev/null
|
||||
|
||||
Reference in New Issue
Block a user