aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit8a9d25ae91a360a71e2f1c36d4a327d661dd6270 (patch)
treed7064cf6f4a64fe8e094ef58d02ec2278aabffae /mdoctree.c
parentff2d2efac021b47be5131aeb11372e2fa6c73f0f (diff)
downloadmandoc-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 'mdoctree.c')
-rw-r--r--mdoctree.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/mdoctree.c b/mdoctree.c
index 65070348..7fcc6255 100644
--- a/mdoctree.c
+++ b/mdoctree.c
@@ -1,4 +1,4 @@
- /* $Id: mdoctree.c,v 1.6 2009/03/08 14:01:46 kristaps Exp $ */
+ /* $Id: mdoctree.c,v 1.7 2009/03/15 07:08:53 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);