summaryrefslogtreecommitdiff
path: root/fstobdf.c
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 /fstobdf.c
parent0d2f3192cc7dedee160702c5eaf4d2b03a21612b (diff)
Add -version option to print version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Diffstat (limited to 'fstobdf.c')
-rw-r--r--fstobdf.c14
1 files changed, 12 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)