[PATCH] Improve consistency of man pages and usage messages.

Vitezslav Crhonek vcrhonek at redhat.com
Mon May 9 14:24:14 MSK 2016


---
 docs/man/man1/dumpkeys.1.in     | 27 +++++++++++++++++++++------
 docs/man/man1/fgconsole.1       | 14 +++++++++++++-
 docs/man/man1/loadkeys.1.in     | 18 ++++++++++++++++++
 docs/man/man1/showkey.1         |  6 +++++-
 docs/man/man8/kbdrate.8         |  2 +-
 docs/man/man8/mapscrn.8.in      |  9 ++++++++-
 docs/man/man8/setvtrgb.8        | 10 +++++++++-
 docs/man/man8/showconsolefont.8 |  6 +++++-
 src/dumpkeys.c                  | 13 +++++++++----
 src/kbdinfo.c                   |  5 ++++-
 src/kbdrate.c                   |  4 ++--
 src/loadkeys.c                  |  3 ++-
 src/mapscrn.c                   |  2 +-
 src/setvtrgb.c                  |  9 +++++++--
 src/showconsolefont.c           |  9 +++++----
 src/showkey.c                   |  1 +
 16 files changed, 111 insertions(+), 27 deletions(-)

diff --git a/docs/man/man1/dumpkeys.1.in b/docs/man/man1/dumpkeys.1.in
index 00f9e66..d3e894f 100644
--- a/docs/man/man1/dumpkeys.1.in
+++ b/docs/man/man1/dumpkeys.1.in
@@ -5,10 +5,15 @@ dumpkeys \- dump keyboard translation tables
 .SH SYNOPSIS
 .B dumpkeys
 [
-.B \-hilfn
+.\".B \-1Vdfhiklnstv
+.B \-h \-\-help \-i \-\-short\-info \-l \-s \-\-long\-info
+.B \-n \-\-numeric \-f \-\-full\-table \-1 \-\-separate-lines
+.BI \-S shape
+.BI \-\-shape= shape
+.B \-t \-\-funcs\-only \-k \-\-keys\-only \-d \-\-compose\-only
 .BI \-c charset
-.B \-\-help \-\-short\-info \-\-long\-info \-\-numeric \-\-full\-table \-\-funcs\-only \-\-keys\-only \-\-compose\-only
 .BI \-\-charset= charset
+.B \-v \-\-verbose \-V \-\-version
 ]
 .SH DESCRIPTION
 .IX "dumpkeys command" "" "\fLdumpkeys\fR command"  
@@ -121,7 +126,7 @@ You can see you current function key definitions with the command
 .RE
 .LP
 .TP
-.B \-l \-\-long-info
+.B \-l \-s \-\-long-info
 This option instructs
 .B dumpkeys
 to print a long information listing. The output is the same as with the
@@ -156,7 +161,10 @@ output of
 .BR dumpkeys .
 .LP
 .TP
-.B \-\-funcs-only
+.BI \-S shape " " " " \-\-shape= shape
+.LP
+.TP
+.B \-t \-\-funcs-only
 When this option is given,
 .B dumpkeys
 prints only the function key string definitions. Normally
@@ -164,7 +172,7 @@ prints only the function key string definitions. Normally
 prints both the key bindings and the string definitions.
 .LP
 .TP
-.B \-\-keys-only
+.B \-k \-\-keys-only
 When this option is given,
 .B dumpkeys
 prints only the key bindings. Normally
@@ -172,7 +180,7 @@ prints only the key bindings. Normally
 prints both the key bindings and the string definitions.
 .LP
 .TP
-.B \-\-compose-only
+.B \-d \-\-compose-only
 When this option is given,
 .B dumpkeys
 prints only the compose key combinations.
@@ -197,6 +205,13 @@ This option produces an output line `charset "iso-8859-X"', telling
 loadkeys how to interpret the keymap. (For example, "division" is
 0xf7 in iso-8859-1 but 0xba in iso-8859-8.)
 .LP
+.TP
+.B \-v \-\-verbose
+.LP
+.TP
+.B \-V \-\-version
+Prints version number and exits.
+.LP
 .SH FILES
 .PD 0
 .TP 20
diff --git a/docs/man/man1/fgconsole.1 b/docs/man/man1/fgconsole.1
index de9652b..3f63890 100644
--- a/docs/man/man1/fgconsole.1
+++ b/docs/man/man1/fgconsole.1
@@ -5,7 +5,13 @@ fgconsole \- print the number of the active VT.
 
 .SH SYNOPSIS
 .B fgconsole
-.BI [ "--help" | "--version" | "--next-available" ]
+.BI [
+\-h \-\-help
+|
+\-V \-\-version
+|
+\-n \-\-next-available
+]
 .SH DESCRIPTION
 If the active Virtual Terminal is
 .IR /dev/ttyN ,
@@ -17,6 +23,12 @@ If the console is a serial console, then
 "serial" 
 is printed instead.
 .TP
+.I \-h \-\-help
+Prints short usage message and exits.
+.TP
+.I \-V \-\-version
+Prints version number and exits.
+.TP
 .I \-\-next\-available
 Will show the next unallocated virtual terminal. Normally 6 virtual
 terminals are allocated, with number 7 used for X; this will return
diff --git a/docs/man/man1/loadkeys.1.in b/docs/man/man1/loadkeys.1.in
index 95e141a..f0e8b0f 100644
--- a/docs/man/man1/loadkeys.1.in
+++ b/docs/man/man1/loadkeys.1.in
@@ -5,6 +5,9 @@ loadkeys \- load keyboard translation tables
 .SH SYNOPSIS
 .B loadkeys
 [
+.I -a --ascii
+] [
+[
 .I -b --bkeymap
 ] [
 .I -c --clearcompose
@@ -19,6 +22,8 @@ loadkeys \- load keyboard translation tables
 ] [
 .I -m --mktable
 ] [
+.I -p --parse
+] [
 .I -q --quiet
 ] [
 .I -s --clearstrings
@@ -27,6 +32,8 @@ loadkeys \- load keyboard translation tables
 ] [
 .I -v --verbose
 ] [
+.I -V --version
+] [
 .I filename...
 ]
 .LP
@@ -177,14 +184,25 @@ instead of using the
 option.
 .SH "OTHER OPTIONS"
 .TP
+.B \-a \-\-ascii
+Force conversion to ASCII.
+.TP
 .B \-h \-\-help
 .B loadkeys
 prints its version number and a short usage message to the programs
 standard error output and exits.
 .TP
+.B \-p \-\-parse
+.B loadkeys
+searchs and parses keymap without action.
+.TP
 .B \-q \-\-quiet
 .B loadkeys
 suppresses all normal output.
+.TP
+.B \-V \-\-version
+.B loadkeys
+prints version number and exits.
 .SH WARNING
 Note that anyone having read access to
 .B /dev/console
diff --git a/docs/man/man1/showkey.1 b/docs/man/man1/showkey.1
index 654e019..7a5b8e1 100644
--- a/docs/man/man1/showkey.1
+++ b/docs/man/man1/showkey.1
@@ -3,7 +3,7 @@
 .SH NAME
 showkey \- examine the codes sent by the keyboard
 .SH SYNOPSIS
-showkey [\-h|\-\-help] [\-a|\-\-ascii] [\-s|\-\-scancodes] [\-k|\-\-keycodes]
+showkey [\-h|\-\-help] [\-a|\-\-ascii] [\-s|\-\-scancodes] [\-k|\-\-keycodes] [\-V|\-\-version]
 .SH DESCRIPTION
 .IX "showkey command" "" "\fLshowkey\fR command"  
 .LP
@@ -66,6 +66,10 @@ are present.
 Starts
 .B showkey
 in `ascii' dump mode.
+.TP
+\-V \-\-version
+.B showkey
+prints version number and exits.
 .SH "2.6 KERNELS"
 In 2.6 kernels key codes lie in the range 1-255, instead of 1-127.
 Key codes larger than 127 are returned as three bytes of which the
diff --git a/docs/man/man8/kbdrate.8 b/docs/man/man8/kbdrate.8
index e0fd890..d16b7c9 100644
--- a/docs/man/man8/kbdrate.8
+++ b/docs/man/man8/kbdrate.8
@@ -48,7 +48,7 @@ For Intel-based systems, the allowable range is from 250 to 1000 ms,
 in 250 ms steps. For SPARC systems, possible values are between 10 ms and 1440 ms,
 in 10 ms steps.
 .TP
-.B \-V
+.B \-V \-\-version
 Display a version number and exit.
 .SH BUGS
 Not all keyboards support all rates.
diff --git a/docs/man/man8/mapscrn.8.in b/docs/man/man8/mapscrn.8.in
index a47d647..613c68b 100644
--- a/docs/man/man8/mapscrn.8.in
+++ b/docs/man/man8/mapscrn.8.in
@@ -3,7 +3,7 @@
 .SH NAME
 mapscrn \- load screen output mapping table
 .SH SYNOPSIS
-.BR mapscrn " [" -v "] [" -o
+.BR mapscrn " [" -V "] [" -v "] [" -o
 .IR map.orig ]
 .I mapfile
 .SH DESCRIPTION
@@ -96,6 +96,13 @@ Single (possibly multi-byte) UTF-8 character, enclosed in single quotes.
 Note that control characters (with codes < 32) cannot be re-mapped with
 .I mapscrn
 because they have special meaning for the driver.
+.SH OTHER OPTIONS
+.TP
+.B \-V
+Prints version number and exits.
+.TP
+.B \-v
+Be verbose.
 .SH FILES
 .I @DATADIR@/consoletrans
 is the default directory for screen mappings.
diff --git a/docs/man/man8/setvtrgb.8 b/docs/man/man8/setvtrgb.8
index 5d723ac..8b315b3 100644
--- a/docs/man/man8/setvtrgb.8
+++ b/docs/man/man8/setvtrgb.8
@@ -4,7 +4,7 @@
 setvtrgb \- set the virtual terminal RGB colors
 .SH SYNOPSIS
 .B setvtrgb
-.I vga|FILE|\-
+.I \-h|\-V|vga|FILE|\-
 .SH DESCRIPTION
 The
 .I setvtrgb
@@ -30,6 +30,14 @@ To seed a valid
 And then edit the values in
 .B FILE
 
+.SH OTHER OPTIONS
+.TP
+\-h
+Prints usage message and exits.
+.TP
+\-V
+Prints version number and exists.
+
 .SH AUTHOR
 The utility is written by Alexey Gladkov, Seth Forshee, Dustin Kirkland.
 
diff --git a/docs/man/man8/showconsolefont.8 b/docs/man/man8/showconsolefont.8
index 6a9423c..2e93d23 100644
--- a/docs/man/man8/showconsolefont.8
+++ b/docs/man/man8/showconsolefont.8
@@ -6,10 +6,12 @@ showconsolefont \- Show the current EGA/VGA console screen font
 .SH SYNOPSIS
 .B showconsolefont
 [
-.B \-V
+.B \-V | \-\-version
 ] [
 .B \-v
 ] [
+.B \-i
+] [
 .B \-C
 .I console
 ]
@@ -20,6 +22,8 @@ The
 command outputs the current console font to stdout.
 The option \-v prints additional information, while
 the option \-V prints the program version number.
+The option \-i doesn't print out the font table,
+just shows ROWSxCOLSxCOUNT and exits.
 On Linux 2.6.1 and later, the option \-C allows one
 to indicate the console involved. Its argument is a pathname.
 
diff --git a/src/dumpkeys.c b/src/dumpkeys.c
index 6762921..0d00124 100644
--- a/src/dumpkeys.c
+++ b/src/dumpkeys.c
@@ -33,19 +33,24 @@ valid options are:\n\
 \n\
 	-h --help	    display this help text\n\
 	-i --short-info	    display information about keyboard driver\n\
-	-l --long-info	    display above and symbols known to loadkeys\n\
+	-l -s --long-info   display above and symbols known to loadkeys\n\
 	-n --numeric	    display keytable in hexadecimal notation\n\
 	-f --full-table	    don't use short-hand notations, one row per keycode\n\
 	-1 --separate-lines one line per (modifier,keycode) pair\n\
-	   --funcs-only	    display only the function key strings\n\
-	   --keys-only	    display only key bindings\n\
-	   --compose-only   display only compose key combinations\n\
+	-S --shape=\n\
+	-t --funcs-only	    display only the function key strings\n\
+	-k --keys-only	    display only key bindings\n\
+	-d --compose-only   display only compose key combinations\n\
 	-c --charset="));
 	lk_list_charsets(stderr);
 	fprintf(stderr, _("\
 			    interpret character action codes to be from the\n\
 			    specified character set\n\
 "));
+	fprintf(stderr, _("\
+	-v --verbose\n\
+	-V --version	    print version number\n\
+"));
 	exit(1);
 }
 
diff --git a/src/kbdinfo.c b/src/kbdinfo.c
index 5cad632..e824fc4 100644
--- a/src/kbdinfo.c
+++ b/src/kbdinfo.c
@@ -18,7 +18,10 @@ usage(int code) {
 		_("Usage: %1$s [-C DEVICE] getmode [text|graphics]\n"
 		  "   or: %1$s [-C DEVICE] gkbmode [raw|xlate|mediumraw|unicode]\n"
 	          "   or: %1$s [-C DEVICE] gkbmeta [metabit|escprefix]\n"
-	          "   or: %1$s [-C DEVICE] gkbled  [scrolllock|numlock|capslock]\n"),
+	          "   or: %1$s [-C DEVICE] gkbled  [scrolllock|numlock|capslock]\n"
+	          "Other options:\n"
+	          "   -h                   print this usage message\n"
+	          "   -V                   print version number\n"),
 		progname);
 	exit(code);
 }
diff --git a/src/kbdrate.c b/src/kbdrate.c
index b9f5ae6..26244dd 100644
--- a/src/kbdrate.c
+++ b/src/kbdrate.c
@@ -247,7 +247,7 @@ main( int argc, char **argv ) {
 	    (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")))
 		print_version_and_exit();
 
-	while ( (c = getopt( argc, argv, "r:d:sv" )) != EOF ) {
+	while ( (c = getopt( argc, argv, "r:d:s" )) != EOF ) {
 		switch (c) {
 		case 'r':
 			rate = atof( optarg );
@@ -260,7 +260,7 @@ main( int argc, char **argv ) {
 			break;
 		default:
 			fprintf(stderr,
-				_("Usage: kbdrate [-V] [-s] [-r rate] [-d delay]\n"));
+				_("Usage: kbdrate [-V | --version] [-s] [-r rate] [-d delay]\n"));
 			exit(EXIT_FAILURE);
 		}
 	}
diff --git a/src/loadkeys.c b/src/loadkeys.c
index ec2fcd9..8b8e7a1 100644
--- a/src/loadkeys.c
+++ b/src/loadkeys.c
@@ -50,7 +50,8 @@ usage(void)
 			  "  -q --quiet         suppress all normal output\n"
 			  "  -s --clearstrings  clear kernel string table\n"
 			  "  -u --unicode       force conversion to Unicode\n"
-			  "  -v --verbose       report the changes\n"),
+			  "  -v --verbose       report the changes\n"
+			  "  -V --version       print version number\n"),
 		PACKAGE_VERSION, progname, DEFMAP);
 	exit(EXIT_FAILURE);
 }
diff --git a/src/mapscrn.c b/src/mapscrn.c
index 8472e2f..9c85524 100644
--- a/src/mapscrn.c
+++ b/src/mapscrn.c
@@ -65,7 +65,7 @@ main(int argc, char *argv[]) {
 	}
 		
 	if (argc != 2) {
-		fprintf(stderr, _("usage: %s [-v] [-o map.orig] map-file\n"),
+		fprintf(stderr, _("usage: %s [-V] [-v] [-o map.orig] map-file\n"),
 			progname);
 		exit(1);
 	}
diff --git a/src/setvtrgb.c b/src/setvtrgb.c
index 412db58..b14aec8 100644
--- a/src/setvtrgb.c
+++ b/src/setvtrgb.c
@@ -39,7 +39,8 @@ static void __attribute__ ((noreturn))
 usage(int code)
 {
 	fprintf(stderr,
-		_("Usage: %s vga|FILE|-\n"
+		_("Usage: %s [-h] [-V]\n"
+		"       %s vga|FILE|-\n"
 		"\n"
 		"If you use the FILE parameter, FILE should be exactly 3 lines of\n"
 		"comma-separated decimal values for RED, GREEN, and BLUE.\n"
@@ -48,8 +49,12 @@ usage(int code)
 		"   cat /sys/module/vt/parameters/default_{red,grn,blu} > FILE\n"
 		"\n"
 		"and then edit the values in FILE.\n"
+		"\n"
+		"Other options:\n"
+		"   -h     print this usage message\n"
+		"   -V     print version number\n"
 		"\n"),
-		progname);
+		progname, progname);
 	exit(code);
 }
 
diff --git a/src/showconsolefont.c b/src/showconsolefont.c
index 56dc575..da2bb96 100644
--- a/src/showconsolefont.c
+++ b/src/showconsolefont.c
@@ -97,10 +97,11 @@ usage(void) {
 		  "(probably after loading a font with `setfont font')\n"
 		  "\n"
 		  "Valid options are:\n"
-		  " -C tty   Device to read the font from. Default: current tty.\n"
-		  " -v       Be more verbose.\n"
-		  " -i       Don't print out the font table, just show\n"
-		  "          ROWSxCOLSxCOUNT and exit.\n"));
+		  " -V --version    Print version number and exit.\n"
+		  " -C tty          Device to read the font from. Default: current tty.\n"
+		  " -v              Be more verbose.\n"
+		  " -i              Don't print out the font table, just show\n"
+		  "                 ROWSxCOLSxCOUNT and exit.\n"));
 	exit(EXIT_FAILURE);
 }
 
diff --git a/src/showkey.c b/src/showkey.c
index b0bb036..48073fc 100644
--- a/src/showkey.c
+++ b/src/showkey.c
@@ -86,6 +86,7 @@ usage(void) {
 "	-a --ascii	display the decimal/octal/hex values of the keys\n"
 "	-s --scancodes	display only the raw scan-codes\n"
 "	-k --keycodes	display only the interpreted keycodes (default)\n"
+"	-V --version	print version number\n"
 ), PACKAGE_VERSION);
 	exit(EXIT_FAILURE);
 }
-- 
2.5.5


--------------994EB377AF55BFFCD952681A--


More information about the kbd mailing list