source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Give catman(8) the -C flag (like apropos and friends) and merge
@ 2011-12-18 18:51 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-12-18 18:51 UTC (permalink / raw)
  To: source

Log Message:
-----------
Give catman(8) the -C flag (like apropos and friends) and merge in some
documentation from apropos(1) to be consistent.

Modified Files:
--------------
    mdocml:
        catman.c
        catman.8

Revision Data
-------------
Index: catman.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/catman.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -Lcatman.c -Lcatman.c -u -p -r1.7 -r1.8
--- catman.c
+++ catman.c
@@ -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",
Index: catman.8
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/catman.8,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lcatman.8 -Lcatman.8 -u -p -r1.2 -r1.3
--- catman.8
+++ catman.8
@@ -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 
 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
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-18 18:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-18 18:51 mdocml: Give catman(8) the -C flag (like apropos and friends) and merge kristaps

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).