From 43ab9b11699acadbf09b8ed050a7a2f7e630dce4 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 8 Nov 2013 23:21:32 -0800 Subject: Add -v flag to print program version Signed-off-by: Alan Coopersmith Reviewed-by: Gaetan Nadon --- man/mkfontscale.man | 5 +++++ mkfontscale.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/man/mkfontscale.man b/man/mkfontscale.man index 4aa88ab..cb18458 100644 --- a/man/mkfontscale.man +++ b/man/mkfontscale.man @@ -38,6 +38,8 @@ mkfontscale \- create an index of scalable font files for X ] [ .B \-u | \-U ] [ +.B \-v +] [ .B \-\- ] [ .I directory @@ -132,6 +134,9 @@ is useful when generating encoding directories only. disable (\fI-u\fP) or enable (\fI-U\fP) indexing of ISO 10646:1 font encodings (default: enabled). .TP +.B \-v +print program version and exit. +.TP .B \-\- end of options. .SH SEE ALSO diff --git a/mkfontscale.c b/mkfontscale.c index 1194145..d73df8c 100644 --- a/mkfontscale.c +++ b/mkfontscale.c @@ -120,7 +120,7 @@ usage(void) "mkfontscale [ -b ] [ -s ] [ -o filename ] [-x suffix ]\n" " [ -a encoding ] [ -f fuzz ] [ -l ]\n" " [ -e directory ] [ -p prefix ] [ -n ] [ -r ] \n" - " [-u] [-U] [ directory ]...\n"); + " [-u] [-U] [-v] [ directory ]...\n"); } int @@ -238,6 +238,9 @@ main(int argc, char **argv) argn++; } else if (strcmp(argv[argn], "-n") == 0) { argn++; + } else if (strcmp(argv[argn], "-v") == 0) { + printf("%s\n", PACKAGE_STRING); + exit(0); } else { usage(); exit(1); -- cgit v1.2.3