diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-11-04 23:31:29 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-11-22 22:28:11 -0800 |
commit | 8d60a7198cc366d72fd03a5821de9b56719588fc (patch) | |
tree | d694ba42fe75ca30aa5d2487f7494305ebc722b7 | |
parent | 5e7991fdcb98c06702a364b856a31541874c51da (diff) |
Add -version option to print version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
-rw-r--r-- | fslsfonts.c | 9 | ||||
-rw-r--r-- | man/fslsfonts.man | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/fslsfonts.c b/fslsfonts.c index 6ff6a2d..9de741e 100644 --- a/fslsfonts.c +++ b/fslsfonts.c @@ -43,6 +43,10 @@ in this Software without prior written authorization from The Open Group. * THIS SOFTWARE. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include <X11/fonts/FSlib.h> #include <stdio.h> #include <X11/Xos.h> @@ -101,6 +105,7 @@ usage(void) " -w width maximum width for multiple columns\n" " -n columns number of columns if multi column\n" " -server servername font server to contact\n" + " -version print command version and exit\n" "\n"); exit(1); } @@ -120,6 +125,10 @@ main(int argc, char *argv[]) usage(); servername = argv[i]; } + else if (strcmp(argv[i], "-version") == 0) { + printf("%s\n", PACKAGE_STRING); + exit(0); + } } if ((svr = FSOpenServer(servername)) == NULL) { diff --git a/man/fslsfonts.man b/man/fslsfonts.man index 35dd1c3..e5975c5 100644 --- a/man/fslsfonts.man +++ b/man/fslsfonts.man @@ -85,6 +85,9 @@ number of character specified by \fB\-w\fP \fIwidth\fP. .TP 8 .B \-u This option indicates that the output should be left unsorted. +.TP 8 +.B \-version +This option prints the program version and exits. .PP .SH ENVIRONMENT .TP 8 |