Linux console tools development discussion
 help / color / mirror / Atom feed
From: Vitezslav Crhonek <vcrhonek@redhat.com>
To: kbd@lists.altlinux.org
Subject: [kbd] Man pages and usage messages review
Date: Tue, 26 Apr 2016 13:54:45 +0200
Message-ID: <571F5705.1090200@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]

Hello,

I reviewed consistency of man pages and usage messages in almost all
utilities shipped within kbd. Patch attached.

Best regards,
Vitezslav Crhonek

[-- Attachment #2: kbd-documentation-consistency.patch --]
[-- Type: text/x-patch, Size: 13263 bytes --]

commit 2e0a25a56102a98a8ce7d5bad0f713f2d36a8f77
Author: Vitezslav Crhonek <vcrhonek@redhat.com>
Date:   Tue Apr 26 13:12:50 2016 +0200

    Improve consistency of man pages and usage messages.

diff --git a/docs/man/man1/dumpkeys.1.in b/docs/man/man1/dumpkeys.1.in
index 00f9e66..8a1fd4a 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 the program's 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..7479184 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
+Displays 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..3997ab3 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 its 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..4d1a22e 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 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..a98bbd5 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
+Display a version number and exit.
+.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..89824c4 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 and exits.
+.TP
+\-V
+Prints version 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..05dcd8d 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	    display version\n\
+"));
 	exit(1);
 }
 
diff --git a/src/kbdinfo.c b/src/kbdinfo.c
index 5cad632..c0ae850 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                   display this help text\n"
+	          "   -V                   display program version\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..bde52e9 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       display version\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..acbd9a6 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     prints usage and exits\n"
+		"   -V     prints version and exits\n"
 		"\n"),
-		progname);
+		progname, progname);
 	exit(code);
 }
 
diff --git a/src/showconsolefont.c b/src/showconsolefont.c
index 56dc575..73c4c53 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 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..cd01221 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	display version\n"
 ), PACKAGE_VERSION);
 	exit(EXIT_FAILURE);
 }

             reply	other threads:[~2016-04-26 11:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26 11:54 Vitezslav Crhonek [this message]
2016-04-26 16:13 ` Felix Janda
2016-04-27  7:27   ` Vitezslav Crhonek
2016-05-09  8:50     ` Alexey Gladkov
2016-05-09 11:47       ` Vitezslav Crhonek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=571F5705.1090200@redhat.com \
    --to=vcrhonek@redhat.com \
    --cc=kbd@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux console tools development discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/kbd/0 kbd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kbd kbd/ http://lore.altlinux.org/kbd \
		kbd@lists.altlinux.org kbd@lists.altlinux.ru kbd@lists.altlinux.com
	public-inbox-index kbd

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.kbd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git