[PATCH xsetroot] Improve manpage and -help option.

Stéphane Aulery lkppo at free.fr
Sun Jul 7 14:23:52 PDT 2013


Signed-off-by: Stéphane Aulery <lkppo at free.fr>
---
 man/xsetroot.man |   44 ++++++++++++++++++++++++++------------------
 xsetroot.c       |   32 ++++++++++++++++----------------
 2 files changed, 42 insertions(+), 34 deletions(-)

diff --git a/man/xsetroot.man b/man/xsetroot.man
index b58b39d..dda6a9c 100644
--- a/man/xsetroot.man
+++ b/man/xsetroot.man
@@ -27,13 +27,23 @@
 xsetroot \- root window parameter setting utility for X
 .SH SYNOPSIS
 .B xsetroot
-[-help] [-version] [-def] [-display \fIdisplay\fP]
+[-help]
+[-version]
+[-def]
+[-display \fIdisplay\fP]
 [-cursor \fIcursorfile maskfile\fP]
-[-cursor_name \fIcursorname\fP]
+[-cursor_name \fIcursorfontname\fP]
 [-xcf \fIcursorfile\fP \fIcursorsize\fP]
-[-bitmap \fIfilename\fP]
-[-mod \fIx y\fP] [-gray] [-grey] [-fg \fIcolor\fP] [-bg \fIcolor\fP] [-rv]
-[-solid \fIcolor\fP] [-name \fIstring\fP]
+[-bitmap \fIfilename\fP
+| -mod \fIx y\fP
+| -gray
+| -grey
+| -solid \fIcolor\fP]
+[-bg \fIcolor\fP]
+[-fg \fIcolor\fP]
+[-rv]
+[-name \fIstring\fP]
+[-d \fIdisplay\fP]
 .SH DESCRIPTION
 The
 .I xsetroot
@@ -56,11 +66,11 @@ Only one of the background color/tiling changing options
 .SH OPTIONS
 .PP
 The various options are as follows:
-.IP \fB-help\fP
+.IP "\fB-help\fP"
 Print a usage message and exit.
-.IP \fB-verson\fP
+.IP "\fB-version\fP"
 Print a version message and exit.
-.IP \fB-def\fP
+.IP "\fB-def, -default\fP"
 Reset unspecified attributes to the default values.  (Restores the background
 to the familiar gray mesh and the cursor to the hollow x shape.)
 .IP "\fB-cursor\fP \fIcursorfile\fP \fImaskfile\fP"
@@ -70,7 +80,7 @@ Cursor and mask files are bitmaps (little pictures), and can be made with the
 .I bitmap(__appmansuffix__)
 program.  You probably want the mask file to be all black until you
 get used to the way masks work.
-.IP "\fB-cursor_name\fP \fIcursorname\fP
+.IP "\fB-cursor_name\fP \fIcursorfontname\fP"
 This lets you change the pointer cursor to one of the standard
 cursors from the cursor font.  Refer to appendix B of the X protocol for
 the names (except that the XC_ prefix is elided for this option).
@@ -87,16 +97,14 @@ the bitmap.
 This is used if you want a plaid-like grid pattern on your screen.
 x and y are integers ranging from 1 to 16.  Try the different combinations.
 Zero and negative numbers are taken as 1.
-.IP \fB-gray\fP
-Make the entire background gray.  (Easier on the eyes.)
-.IP \fB-grey\fP
-Make the entire background grey.
-.IP "\fB-fg\fP \fIcolor\fP"
+.IP "\fB-gray, -grey\fP"
+Make the entire background gray (Easier on the eyes).
+.IP "\fB-bg, -background\fP \fIcolor\fP"
+Use ``color'' as the background color.
+.IP "\fB-fg, -foreground\fP \fIcolor\fP"
 Use ``color'' as the foreground color.  Foreground and background colors
 are meaningful only in combination with -cursor, -bitmap, or -mod.
-.IP "\fB-bg\fP \fIcolor\fP"
-Use ``color'' as the background color.
-.IP \fB-rv\fP
+.IP "\fB-rv, -reverse\fP"
 This exchanges the foreground and background colors.  Normally the foreground
 color is black and the background color is white.
 .IP "\fB-solid\fP \fIcolor\fP"
@@ -107,7 +115,7 @@ Set the name of the root window to ``string''.  There is no default value.
 Usually a name is assigned to a window so that the
 window manager can use a text representation when the window is iconified.
 This option is unused since you can't iconify the background.
-.IP "\fB-display\fP \fIdisplay\fP"
+.IP "\fB-d, -display\fP \fIdisplay\fP"
 Specifies the server to connect to; see \fIX(__miscmansuffix__)\fP.
 .SH "SEE ALSO"
 X(__miscmansuffix__), xset(__appmansuffix__), xrdb(__appmansuffix__), Xcursor(__libmansuffix__)
diff --git a/xsetroot.c b/xsetroot.c
index 06bf6fa..be82861 100644
--- a/xsetroot.c
+++ b/xsetroot.c
@@ -73,23 +73,23 @@ static Pixmap ReadBitmapFile(char *filename, unsigned int *width, unsigned int *
 static void
 usage(void)
 {
-    fprintf(stderr, "usage: %s [options]\n", program_name,
+    fprintf(stderr, "Usage: %s [options]\n", program_name,
             "  where options are:\n"
-            "  -display <display>   or   -d <display>\n"
-            "  -fg <color>   or   -foreground <color>\n"
-            "  -bg <color>   or   -background <color>\n"
-            "  -rv   or   -reverse\n"
-            "  -def   or   -default\n"
-            "  -name <string>\n"
-            "  -cursor <cursor file> <mask file>\n"
-            "  -cursor_name <cursor-font name>\n"
-            "  -xcf <ARGB cursor file> <cursor size>\n"
-            "  -solid <color>\n"
-            "  -gray   or   -grey\n"
-            "  -bitmap <filename>\n"
-            "  -mod <x> <y>\n"
-            "  -help\n"
-            "  -version\n"
+	    "  -help                           Print this help\n"
+	    "  -version                        Print a version message\n"
+	    "  -def, -default                  Reset unspecified attributes\n"
+	    "  -cursor <cursorfile> <maskfile> Pointer cursor used when outside of any windows\n"
+	    "  -cursor_name <cursorfontname>   Use a pointer cursor from the cursor font\n"
+	    "  -xcf <cursorfile> <cursorsize>  Load a pointer cursor from an Xcursor file\n"
+	    "  -bitmap <filename>              Use the bitmap specified in the file\n"
+	    "  -mod <x> <y>                    Use a plaid-like grid pattern on screen\n"
+	    "  -gray, -grey                    Make the entire background grey\n"
+	    "  -bg,  -background <color>       Set background color\n"
+	    "  -fg,  -foreground <color>       Set foreground color\n"
+	    "  -rv,  -reverse                  Swap foreground and background colors\n"
+	    "  -solid <color>                  Set the background of the root window\n"
+	    "  -name <string>                  Set the name of the root window\n"
+	    "  -d,   -display <display>        Specifies the server to connect to\n"
             );
     exit(1);
     /*NOTREACHED*/
-- 
1.7.10.4



More information about the xorg-devel mailing list