From 0d9470784d26b2926cea58b30ad4c1587cbedb14 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 18 Dec 2011 18:51:01 +0000 Subject: Give catman(8) the -C flag (like apropos and friends) and merge in some documentation from apropos(1) to be consistent. --- catman.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'catman.c') 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 * @@ -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", -- cgit v1.2.3