kbdcontrol -h prints two error messages.
We loop through getopt(3) twice. Once for -P args and once for the rest. Catch '?' and print usage when that happens.
This commit is contained in:
parent
893caf588a
commit
73701bbe9d
@ -1220,9 +1220,12 @@ main(int argc, char **argv)
|
||||
int opt;
|
||||
|
||||
/* Collect any -P arguments, regardless of where they appear. */
|
||||
while ((opt = getopt(argc, argv, optstring)) != -1)
|
||||
while ((opt = getopt(argc, argv, optstring)) != -1) {
|
||||
if (opt == 'P')
|
||||
add_keymap_path(optarg);
|
||||
if (opt == '?')
|
||||
usage();
|
||||
}
|
||||
|
||||
optind = optreset = 1;
|
||||
while ((opt = getopt(argc, argv, optstring)) != -1)
|
||||
|
Loading…
Reference in New Issue
Block a user