- /* $Id: mmain.c,v 1.3 2009/02/23 12:45:19 kristaps Exp $ */
+ /* $Id: mmain.c,v 1.5 2009/03/06 14:13:47 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
extern int optind;
- sz = strlcpy(opts, "vW:", 32);
+ sz = strlcpy(opts, "VvW:", 32);
assert(sz < 32);
if (u) {
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;
}
-__dead void
-mmain_exit(struct mmain *p, int code)
+dead_pre void
+mmain_exit(struct mmain *p, int code)
{
if (p->mdoc)