=================================================================== RCS file: /cvs/mandoc/Attic/mdoclint.c,v retrieving revision 1.1 retrieving revision 1.4 diff -u -p -r1.1 -r1.4 --- mandoc/Attic/mdoclint.c 2009/02/23 13:05:06 1.1 +++ mandoc/Attic/mdoclint.c 2009/03/16 23:37:28 1.4 @@ -1,6 +1,6 @@ - /* $Id: mdoclint.c,v 1.1 2009/02/23 13:05:06 kristaps Exp $ */ +/* $Id: mdoclint.c,v 1.4 2009/03/16 23:37:28 kristaps Exp $ */ /* - * Copyright (c) 2008 Kristaps Dzonsons + * Copyright (c) 2008, 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the @@ -28,15 +28,22 @@ int main(int argc, char *argv[]) { struct mmain *p; - const struct mdoc *mdoc; + int c; p = mmain_alloc(); - if ( ! mmain_getopt(p, argc, argv, NULL, NULL, NULL, NULL)) - mmain_exit(p, 1); + c = mmain_getopt(p, argc, argv, NULL, + "[infile...]", NULL, NULL, NULL); - if (NULL == (mdoc = mmain_mdoc(p))) - mmain_exit(p, 1); + argv += c; + if (0 == (argc -= c)) + mmain_exit(p, NULL != mmain_mdoc(p, "-")); + + while (c-- > 0) { + if (NULL == mmain_mdoc(p, *argv++)) + mmain_exit(p, 1); + mmain_reset(p); + } mmain_exit(p, 0); /* NOTREACHED */