summaryrefslogtreecommitdiffstats
path: root/mdoctree.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-15 07:08:52 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-15 07:08:52 +0000
commit885216263c7b90bf8b3fe9284d6f22d75a7ad7b4 (patch)
tree6a0f1485e03b97dd0e4b7357cf346656f85ede72 /mdoctree.c
parentc4b5d8a0192a406d9f04a23e2c8a768a29e01371 (diff)
downloadmandoc-885216263c7b90bf8b3fe9284d6f22d75a7ad7b4.tar.gz
mdoclint accepts multiple files
mdocterm punts to nroff if it fails parsing
Diffstat (limited to 'mdoctree.c')
-rw-r--r--mdoctree.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mdoctree.c b/mdoctree.c
index 18e975da..5ad68e32 100644
--- a/mdoctree.c
+++ b/mdoctree.c
@@ -32,16 +32,22 @@ int
main(int argc, char *argv[])
{
struct mmain *p;
- int c;
const struct mdoc *mdoc;
+ int c;
+ char *in;
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);
+
+ argv += c;
+ if ((argc -= c) > 0)
+ in = *argv++;
+ else
+ in = "-";
- if (NULL == (mdoc = mmain_mdoc(p)))
+ if (NULL == (mdoc = mmain_mdoc(p, in)))
mmain_exit(p, 1);
doprint(mdoc_node(mdoc), 0);