summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-11-05 22:38:53 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-11-22 22:29:09 -0800
commitf557d6258105ac2717093aebfd2fcbcb16730593 (patch)
tree62e55fa37ac7443051923291419db8e291bff067
parent0d2f3192cc7dedee160702c5eaf4d2b03a21612b (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--fstobdf.c14
-rw-r--r--man/fstobdf.man6
2 files changed, 18 insertions, 2 deletions
diff --git a/fstobdf.c b/fstobdf.c
index bcdffbc..5fe4816 100644
--- a/fstobdf.c
+++ b/fstobdf.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 <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -54,8 +58,10 @@ usage(const char *progName, const char *msg)
{
if (msg)
fprintf(stderr, "%s: %s\n", progName, msg);
- fprintf(stderr, "Usage: %s [-server <font server>] -fn <font name>\n",
- progName);
+ fprintf(stderr,
+ "Usage: %s [-server <font server>] -fn <font name>\n"
+ " or: %s -version\n",
+ progName, progName);
exit(0);
}
@@ -99,6 +105,10 @@ main(int argc, char *argv[])
else
usage(argv[0], "-fn requires an argument");
}
+ else if (!strcmp(argv[i], "-version")) {
+ printf("%s\n", PACKAGE_STRING);
+ exit(0);
+ }
}
if (fontName == NULL)
diff --git a/man/fstobdf.man b/man/fstobdf.man
index 9c1c0eb..729a429 100644
--- a/man/fstobdf.man
+++ b/man/fstobdf.man
@@ -35,6 +35,8 @@ fstobdf \- generate BDF font from X font server
]
.B \-fn
.I fontname
+.TP
+.B fstobdf \-version
.SH DESCRIPTION
The \fIfstobdf\fP program reads a font from a font server and prints a BDF
file on the standard output that may be used to recreate the font.
@@ -53,6 +55,10 @@ environment variable is used.
.TP 8
.B \-fn \fIfontname\fP
This option specifies the font for which a BDF file should be generated.
+.TP 8
+.B \-version
+This option prints the program version and then exits without generating
+a BDF file.
.SH ENVIRONMENT
.TP 8
.B FONTSERVER