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:
Warner Losh 2019-06-24 21:05:14 +00:00
parent 893caf588a
commit 73701bbe9d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349346

View File

@ -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)