]> git.cameronkatri.com Git - mandoc.git/blobdiff - mmain.c
Strings abstracted into dynamically-created C files.
[mandoc.git] / mmain.c
diff --git a/mmain.c b/mmain.c
index c1294f8a97395cf71d46c62f5c4156ee123856be..0660f2843dd8b96e1ca17f3c530815d59370bd07 100644 (file)
--- a/mmain.c
+++ b/mmain.c
@@ -1,4 +1,4 @@
-       /* $Id: mmain.c,v 1.4 2009/02/23 15:38:20 kristaps Exp $ */
+       /* $Id: mmain.c,v 1.5 2009/03/06 14:13:47 kristaps Exp $ */
 /*
  * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
  *
@@ -109,7 +109,7 @@ mmain_getopt(struct mmain *p, int argc, char *argv[],
 
        extern int       optind;
 
-       sz = strlcpy(opts, "vW:", 32);
+       sz = strlcpy(opts, "VvW:", 32);
        assert(sz < 32);
 
        if (u) {
@@ -125,18 +125,21 @@ mmain_getopt(struct mmain *p, int argc, char *argv[],
                case ('v'):
                        p->dbg++;
                        break;
+               case ('V'):
+                       (void)printf("%s %s\n", __progname, VERSION);
+                       return(0);
                case ('W'):
                        if ( ! getsopts(p, optarg))
-                               return(0);
+                               return(-1);
                        break;
                case ('?'):
                        mmain_usage(help);
-                       return(0);
+                       return(-1);
                default:
                        assert(getopt_cb);
                        if ((*getopt_cb)(arg, c, optarg))
                                break;
-                       return(0);
+                       return(-1);
                }
 
        argv += optind;