diff options
author | des <des@FreeBSD.org> | 2001-05-28 11:05:28 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-05-28 11:05:28 +0000 |
commit | 7c380d00127e5c002ff524805ce2a0c8164684c7 (patch) | |
tree | f90e143680a1afb4f92e2d3fe2dd2f948d7a6068 /usr.sbin/kbdcontrol | |
parent | 13b0e9b8e7b63dbad42826e41d056ecc3332f1f8 (diff) | |
download | FreeBSD-src-7c380d00127e5c002ff524805ce2a0c8164684c7.zip FreeBSD-src-7c380d00127e5c002ff524805ce2a0c8164684c7.tar.gz |
Move the scrollback controls from kbdcontrol to vidcontrol.
Also fix some style bugs in the code and poor language in the man pages.
Reviewed by: sobomax
Diffstat (limited to 'usr.sbin/kbdcontrol')
-rw-r--r-- | usr.sbin/kbdcontrol/kbdcontrol.1 | 13 | ||||
-rw-r--r-- | usr.sbin/kbdcontrol/kbdcontrol.c | 111 |
2 files changed, 42 insertions, 82 deletions
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.1 b/usr.sbin/kbdcontrol/kbdcontrol.1 index 2197b9b..c6041eb 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.1 +++ b/usr.sbin/kbdcontrol/kbdcontrol.1 @@ -13,15 +13,15 @@ .\" @(#)kbdcontrol.1 .\" $FreeBSD$ .\" -.Dd May 24, 2001 +.Dd May 27, 2001 .Dt KBDCONTROL 1 .Os .Sh NAME .Nm kbdcontrol -.Nd a utility for manipulating the syscons console driver +.Nd keyboard control and configuration utility .Sh SYNOPSIS .Nm -.Op Fl cdFKix +.Op Fl dFKix .Oo .Fl b .Ar duration . Ns Ar pitch | Ar belltype @@ -32,7 +32,6 @@ .Oc .Op Fl l Ar keymap_file .Op Fl f Ar # Ar string -.Op Fl h Ar size .Op Fl k Ar keyboard_device .Op Fl L Ar keymap_file .Sh DESCRIPTION @@ -97,8 +96,6 @@ Install keyboard map file from .Ar keymap_file . You may load the keyboard map file from a menu-driven command, .Xr kbdmap 1 . -.It Fl c -Clear the history buffer. .It Fl d Dump the current keyboard map onto stdout. The output may be redirected to a file and can be loaded @@ -117,10 +114,6 @@ for available function keys and their numbers. Set function keys back to the standard definitions. .It Fl x Use hexadecimal numbers in keyboard map dump. -.It Fl h Ar size -Set history buffer size to -.Ar size -lines. .It Fl i Print brief information about the keyboard. .It Fl K diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index 577d919..122bc85 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -965,33 +965,6 @@ badopt: } } - -void -set_history(char *opt) -{ - int size; - - size = atoi(opt); - if ((*opt == '\0') || size < 0) { - warnx("argument must be a positive number"); - return; - } - if (ioctl(0, CONS_HISTORY, &size) == -1) - warn("setting history buffer size"); -} - -void -clear_history() -{ - -#ifdef CONS_CLRHIST - if (ioctl(0, CONS_CLRHIST) == -1) - warn("clear history buffer"); -#else - warnx("clearing history not supported"); -#endif -} - static char *get_kbd_type_name(int type) { @@ -1091,9 +1064,9 @@ static void usage() { fprintf(stderr, "%s\n%s\n%s\n", -"usage: kbdcontrol [-cdFKix] [-b duration.pitch | [quiet.]belltype]", +"usage: kbdcontrol [-dFKix] [-b duration.pitch | [quiet.]belltype]", " [-r delay.repeat | speed] [-l mapfile] [-f # string]", -" [-h size] [-k device] [-L mapfile]"); +" [-k device] [-L mapfile]"); exit(1); } @@ -1103,50 +1076,44 @@ main(int argc, char **argv) { int opt; - while((opt = getopt(argc, argv, "b:cdf:h:iKk:Fl:L:r:x")) != -1) + while((opt = getopt(argc, argv, "b:df:iKk:Fl:L:r:x")) != -1) switch(opt) { - case 'b': - set_bell_values(optarg); - break; - case 'c': - clear_history(); - break; - case 'd': - print_keymap(); - break; - case 'l': - load_keymap(optarg, 0); - break; - case 'L': - load_keymap(optarg, 1); - break; - case 'f': - set_functionkey(optarg, - nextarg(argc, argv, &optind, 'f')); - break; - case 'F': - load_default_functionkeys(); - break; - case 'h': - set_history(optarg); - break; - case 'i': - show_kbd_info(); - break; - case 'K': - release_keyboard(); - break; - case 'k': - set_keyboard(optarg); - break; - case 'r': - set_keyrates(optarg); - break; - case 'x': - hex = 1; - break; - default: - usage(); + case 'b': + set_bell_values(optarg); + break; + case 'd': + print_keymap(); + break; + case 'l': + load_keymap(optarg, 0); + break; + case 'L': + load_keymap(optarg, 1); + break; + case 'f': + set_functionkey(optarg, + nextarg(argc, argv, &optind, 'f')); + break; + case 'F': + load_default_functionkeys(); + break; + case 'i': + show_kbd_info(); + break; + case 'K': + release_keyboard(); + break; + case 'k': + set_keyboard(optarg); + break; + case 'r': + set_keyrates(optarg); + break; + case 'x': + hex = 1; + break; + default: + usage(); } if ((optind != argc) || (argc == 1)) usage(); |