- /* $Id: mdoctree.c,v 1.3 2009/02/23 07:09:13 kristaps Exp $ */
+ /* $Id: mdoctree.c,v 1.5 2009/03/06 14:13:47 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
int
main(int argc, char *argv[])
{
- struct mmain *p;
+ struct mmain *p;
+ int c;
const struct mdoc *mdoc;
- extern int optreset;
- extern int optind;
-
p = mmain_alloc();
- if ( ! mmain_getopt(p, argc, argv, NULL, NULL, NULL, NULL))
- mmain_exit(p, 1);
+ c = mmain_getopt(p, argc, argv, NULL, NULL, NULL, NULL);
+ if (1 != c)
+ mmain_exit(p, -1 == c ? 1 : 0);
if (NULL == (mdoc = mmain_mdoc(p)))
mmain_exit(p, 1);