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 | 8a9d25ae91a360a71e2f1c36d4a327d661dd6270 (patch) | |
tree | d7064cf6f4a64fe8e094ef58d02ec2278aabffae /mdoclint.c | |
parent | ff2d2efac021b47be5131aeb11372e2fa6c73f0f (diff) | |
download | mandoc-8a9d25ae91a360a71e2f1c36d4a327d661dd6270.tar.gz mandoc-8a9d25ae91a360a71e2f1c36d4a327d661dd6270.tar.zst mandoc-8a9d25ae91a360a71e2f1c36d4a327d661dd6270.zip |
mdoclint accepts multiple files
mdocterm punts to nroff if it fails parsing
Diffstat (limited to 'mdoclint.c')
-rw-r--r-- | mdoclint.c | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -1,4 +1,4 @@ - /* $Id: mdoclint.c,v 1.2 2009/03/06 14:13:47 kristaps Exp $ */ + /* $Id: mdoclint.c,v 1.3 2009/03/15 07:08:52 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se> * @@ -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 */ |