aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/manpath.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2020-07-21 15:10:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2020-07-21 15:10:01 +0000
commit34c3fd437f1b1a9f91c688bf395a99c631b642ed (patch)
tree457254f96054c09e8e8c023fc4e684b34c589021 /manpath.c
parenteb396f5b0bb17fecfc3db0045d2979fa42d4478d (diff)
downloadmandoc-34c3fd437f1b1a9f91c688bf395a99c631b642ed.tar.gz
mandoc-34c3fd437f1b1a9f91c688bf395a99c631b642ed.tar.zst
mandoc-34c3fd437f1b1a9f91c688bf395a99c631b642ed.zip
undocumented options -O outfilename and -O tagfilename
to support regression testing without a tty; no user visible change intended
Diffstat (limited to 'manpath.c')
-rw-r--r--manpath.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/manpath.c b/manpath.c
index 49c650cc..2a8c7df0 100644
--- a/manpath.c
+++ b/manpath.c
@@ -1,4 +1,4 @@
-/* $Id: manpath.c,v 1.41 2020/02/10 14:42:10 schwarze Exp $ */
+/* $Id: manpath.c,v 1.42 2020/07/21 15:10:01 schwarze Exp $ */
/*
* Copyright (c) 2011,2014,2015,2017-2019 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -224,7 +224,8 @@ manconf_output(struct manoutput *conf, const char *cp, int fromfile)
{
const char *const toks[] = {
"includes", "man", "paper", "style", "indent", "width",
- "tag", "fragment", "mdoc", "noval", "toc"
+ "tag", "outfilename", "tagfilename",
+ "fragment", "mdoc", "noval", "toc"
};
const size_t ntoks = sizeof(toks) / sizeof(toks[0]);
@@ -245,11 +246,11 @@ manconf_output(struct manoutput *conf, const char *cp, int fromfile)
}
}
- if (tok < 6 && *cp == '\0') {
+ if (tok < 8 && *cp == '\0') {
mandoc_msg(MANDOCERR_BADVAL_MISS, 0, 0, "-O %s=?", toks[tok]);
return -1;
}
- if (tok > 6 && tok < ntoks && *cp != '\0') {
+ if (tok > 8 && tok < ntoks && *cp != '\0') {
mandoc_msg(MANDOCERR_BADVAL, 0, 0, "-O %s=%s", toks[tok], cp);
return -1;
}
@@ -313,15 +314,29 @@ manconf_output(struct manoutput *conf, const char *cp, int fromfile)
conf->tag = mandoc_strdup(cp);
return 0;
case 7:
- conf->fragment = 1;
+ if (conf->outfilename != NULL) {
+ oldval = mandoc_strdup(conf->outfilename);
+ break;
+ }
+ conf->outfilename = mandoc_strdup(cp);
return 0;
case 8:
- conf->mdoc = 1;
+ if (conf->tagfilename != NULL) {
+ oldval = mandoc_strdup(conf->tagfilename);
+ break;
+ }
+ conf->tagfilename = mandoc_strdup(cp);
return 0;
case 9:
- conf->noval = 1;
+ conf->fragment = 1;
return 0;
case 10:
+ conf->mdoc = 1;
+ return 0;
+ case 11:
+ conf->noval = 1;
+ return 0;
+ case 12:
conf->toc = 1;
return 0;
default: