aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-12-18 18:51:01 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-12-18 18:51:01 +0000
commit0d9470784d26b2926cea58b30ad4c1587cbedb14 (patch)
tree7837ecb7e92861752cb37561aae701eba52dc66c
parent8ba55f016df3035abde0f0e18009fd202d208c7d (diff)
downloadmandoc-0d9470784d26b2926cea58b30ad4c1587cbedb14.tar.gz
mandoc-0d9470784d26b2926cea58b30ad4c1587cbedb14.tar.zst
mandoc-0d9470784d26b2926cea58b30ad4c1587cbedb14.zip
Give catman(8) the -C flag (like apropos and friends) and merge in some
documentation from apropos(1) to be consistent.
-rw-r--r--catman.822
-rw-r--r--catman.c12
2 files changed, 27 insertions, 7 deletions
diff --git a/catman.8 b/catman.8
index 4b6b5853..af7353ac 100644
--- a/catman.8
+++ b/catman.8
@@ -1,4 +1,4 @@
-.\" $Id: catman.8,v 1.2 2011/12/04 22:52:50 kristaps Exp $
+.\" $Id: catman.8,v 1.3 2011/12/18 18:51:01 kristaps Exp $
.\"
.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: December 4 2011 $
+.Dd $Mdocdate: December 18 2011 $
.Dt CATMAN 8
.Os
.Sh NAME
@@ -23,6 +23,7 @@
.Sh SYNOPSIS
.Nm catman
.Op Fl fv
+.Op Fl C Ar file
.Op Fl M Ar manpath
.Op Fl m Ar manpath
.Op Fl o Ar path
@@ -37,6 +38,12 @@ Its arguments are as follows:
Force an update to all files.
.It Fl v
Print each file being updated.
+.It Fl C Ar file
+Specify an alternative configuration
+.Ar file
+in
+.Xr man.conf 5
+format.
.It Fl M Ar manpath
Use the colon-separated path instead of the default list of paths
searched for
@@ -44,7 +51,7 @@ searched for
databases.
Invalid paths, or paths without manual databases, are ignored.
.It Fl m Ar manpath
-Append the colon-separated paths to the list of paths searched
+Prepend the colon-separated paths to the list of paths searched
for
.Xr mandocdb 8
databases.
@@ -70,6 +77,15 @@ Cached manual pages are only updated if older than the master copy.
If
.Fl f
is specified, all files are updated.
+.Sh ENVIRONMENT
+.Bl -tag -width Ds
+.It Ev MANPATH
+Colon-separated paths overriding the default list of paths searched for
+manual databases.
+Invalid paths, or paths without manual databases, are ignored.
+Overridden by
+.Fl M .
+.El
.Sh EXIT STATUS
.Ex -std
.Sh SEE ALSO
diff --git a/catman.c b/catman.c
index 2ac27e5a..aa185eb3 100644
--- a/catman.c
+++ b/catman.c
@@ -1,4 +1,4 @@
-/* $Id: catman.c,v 1.7 2011/12/16 12:06:35 kristaps Exp $ */
+/* $Id: catman.c,v 1.8 2011/12/18 18:51:01 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -66,7 +66,7 @@ int
main(int argc, char *argv[])
{
int ch;
- char *aux, *base;
+ char *aux, *base, *conf_file;
struct manpaths dirs;
char buf[MAXPATHLEN];
extern char *optarg;
@@ -81,8 +81,11 @@ main(int argc, char *argv[])
aux = base = NULL;
xstrlcpy(buf, "/var/www/cache/man.cgi", MAXPATHLEN);
- while (-1 != (ch = getopt(argc, argv, "fm:M:o:v")))
+ while (-1 != (ch = getopt(argc, argv, "C:fm:M:o:v")))
switch (ch) {
+ case ('C'):
+ conf_file = optarg;
+ break;
case ('f'):
force = 1;
break;
@@ -112,7 +115,7 @@ main(int argc, char *argv[])
}
memset(&dirs, 0, sizeof(struct manpaths));
- manpath_parse(&dirs, NULL, base, aux);
+ manpath_parse(&dirs, conf_file, base, aux);
ch = manup(&dirs, buf);
manpath_free(&dirs);
return(ch ? EXIT_SUCCESS : EXIT_FAILURE);
@@ -124,6 +127,7 @@ usage(void)
fprintf(stderr, "usage: %s "
"[-fv] "
+ "[-C file] "
"[-o path] "
"[-m manpath] "
"[-M manpath]\n",