diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-12-18 18:51:01 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-12-18 18:51:01 +0000 |
commit | 8b085aba08a98619780dc5406fca3cf10bb7cdb6 (patch) | |
tree | 649a5741d272726bc12e5c030ecc830452746f94 | |
parent | 29f1f9aeaaf5e15d9d3101a0887b102b9b24c96f (diff) | |
download | mandoc-8b085aba08a98619780dc5406fca3cf10bb7cdb6.tar.gz |
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.8 | 18 | ||||
-rw-r--r-- | catman.c | 10 |
2 files changed, 24 insertions, 4 deletions
@@ -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 @@ -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", |