summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-06-03 22:58:53 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-06-03 22:58:53 -0700
commit07cbc124b54b866fa7ab40444d22bdd9018fc5b3 (patch)
treefb9be4402cbb71121ea43b77aadbcfac8b93f901
parentb02dd8658fe8c70a77f9134cd2258f423d30e6fe (diff)
Add -version option to print program version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--man/xrefresh.man4
-rw-r--r--xrefresh.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/man/xrefresh.man b/man/xrefresh.man
index 6da5515..fc4c8ed 100644
--- a/man/xrefresh.man
+++ b/man/xrefresh.man
@@ -74,6 +74,10 @@ Specifies the portion of the screen to be repainted; see \fIX(__miscmansuffix__)
.B \-display \fIdisplay\fP
This argument allows you to specify the server and screen to
refresh; see \fIX(__miscmansuffix__)\fP.
+.PP
+.TP 10
+.B \-version
+This argument prints the program version and exits.
.SH X DEFAULTS
The
.I xrefresh
diff --git a/xrefresh.c b/xrefresh.c
index 4fd9595..f72379d 100644
--- a/xrefresh.c
+++ b/xrefresh.c
@@ -81,7 +81,9 @@ Syntax(void)
" -white use WhitePixel\n"
" -solid colorname use the color indicated\n"
" -root use the root background\n"
- " -none no background in window\n");
+ " -none no background in window\n"
+ " -version print program version\n"
+ );
fprintf (stderr, "\nThe default is: %s -none\n\n", ProgramName);
exit (1);
}
@@ -226,6 +228,9 @@ main(int argc, char *argv[])
} else if (isabbreviation ("-root", arg, 2)) {
action = doRoot;
continue;
+ } else if (isabbreviation ("-version", arg, 1)) {
+ puts(PACKAGE_STRING);
+ exit(0);
} else
unknown_arg (arg);
} else if (arg[0] == '=') /* obsolete */