diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-15 07:08:52 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-15 07:08:52 +0000 |
commit | 885216263c7b90bf8b3fe9284d6f22d75a7ad7b4 (patch) | |
tree | 6a0f1485e03b97dd0e4b7357cf346656f85ede72 /mdoclint.c | |
parent | c4b5d8a0192a406d9f04a23e2c8a768a29e01371 (diff) | |
download | mandoc-885216263c7b90bf8b3fe9284d6f22d75a7ad7b4.tar.gz |
mdoclint accepts multiple files
mdocterm punts to nroff if it fails parsing
Diffstat (limited to 'mdoclint.c')
-rw-r--r-- | mdoclint.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -29,16 +29,21 @@ main(int argc, char *argv[]) { struct mmain *p; int c; - const struct mdoc *mdoc; p = mmain_alloc(); - c = mmain_getopt(p, argc, argv, NULL, NULL, NULL, NULL); - if (1 != c) - mmain_exit(p, -1 == c ? 1 : 0); + 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 */ |