wmcliphist: Add -v command line option to print version.

This commit is contained in:
Doug Torrance 2014-11-22 20:48:51 -06:00 committed by Carlos R. Mafra
parent 7aa3b460c3
commit a32b41a0a2
2 changed files with 9 additions and 1 deletions

View file

@ -3,7 +3,7 @@
wmcliphist \(em provides a history to X11 selections
.SH "SYNOPSIS"
.PP
\fBwmcliphist\fR [\fB-h\fP] [\fB-n \fInum\fR\fP] [\fB-c \fIcol\fR\fP] [\fB-i \fInum\fR\fP] [\fB-s \fIsize\fR\fP]
\fBwmcliphist\fR [\fB-h\fP] [\fB-v\fP] [\fB-n \fInum\fR\fP] [\fB-c \fIcol\fR\fP] [\fB-i \fInum\fR\fP] [\fB-s \fIsize\fR\fP]
.SH "DESCRIPTION"
.PP
This manual page documents briefly the program
@ -24,6 +24,8 @@ your $HOME. Find a well documented example in /usr/share/doc/wmcliphist.
.SH "OPTIONS"
.IP "\fB-h\fP " 10
Show summary of options.
.IP "\fB-v\fP " 10
Print version.
.IP "\fB-n num\fP " 10
Set the number of items to keep in the history.
Default is 10.

View file

@ -4,6 +4,8 @@
#include "wmcliphist.h"
#define WMCLIPHIST_VERSION "2.0"
/*
* print some help
*/
@ -16,6 +18,7 @@ print_help()
"wmcliphist is small dock applet for Window Maker which "
"keeps X clipboard history\n\n");
fprintf(stderr, "-h show this help\n"
"-v print version\n"
"-n <num> set number of items to keep (default 10)\n"
"-c color set color for locked items (default is red)\n"
"-s <size> choose wmcliphist icon size:\n"
@ -163,6 +166,9 @@ main(int argc, char **argv)
}
} else if (*(arg + 1) == 'd') {
dump_only = TRUE;
} else if (*(arg + 1) == 'v') {
printf("wmcliphist "WMCLIPHIST_VERSION"\n");
exit(1);
} else {
fprintf(stderr, "Invalid option -%c\n", *(arg + 1));
print_help();