summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-08-16 23:04:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-08-16 23:04:25 +0000
commite787f86b365b1779d9ea4b2c1b4b35617a18d0ba (patch)
tree99794137b11a26bbda78403db11f7d76c5634afb /main.c
parent793fa839780278ce837bbf49d61586b868ac4eb4 (diff)
downloadmandoc-e787f86b365b1779d9ea4b2c1b4b35617a18d0ba.tar.gz
When BUILD_DB is active, link apropos(1) into the mandoc binary.
This is the first step on the way to a man(1) implementation. The new ./configure is flexible enough to make this step quite easy.
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.c b/main.c
index fe520ad2..de1f33f4 100644
--- a/main.c
+++ b/main.c
@@ -68,6 +68,10 @@ struct curparse {
char outopts[BUFSIZ]; /* buf of output opts */
};
+#if HAVE_SQLITE3
+int apropos(int, char**);
+#endif
+
static int moptions(int *, char *);
static void mmsg(enum mandocerr, enum mandoclevel,
const char *, int, int, const char *);
@@ -96,6 +100,12 @@ main(int argc, char *argv[])
else
++progname;
+#if HAVE_SQLITE3
+ if (0 == strncmp(progname, "apropos", 7) ||
+ 0 == strncmp(progname, "whatis", 6))
+ return(apropos(argc, argv));
+#endif
+
memset(&curp, 0, sizeof(struct curparse));
options = MPARSE_SO;