NetBSD/usr.sbin/makemandb/makemandb.8

127 lines
4.1 KiB
Groff

.\" $NetBSD: makemandb.8,v 1.10 2016/06/18 06:36:18 abhinav Exp $
.\"
.\" Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>
.\" All rights reserved.
.\"
.\" This code was developed as part of Google's Summer of Code 2011 program.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd June 18, 2016
.Dt MAKEMANDB 8
.Os
.Sh NAME
.Nm makemandb
.Nd parse the manual pages and build a search index for
.Xr apropos 1
.Sh SYNOPSIS
.Nm
.Op Fl floQqv
.Op Fl C Ar path
.Sh DESCRIPTION
The
.Nm
utility traverses the directories containing man pages, parses the manual
pages with the help of
.Xr mandoc 3
and builds an Sqlite database
to support full text searches by
.Xr apropos 1 .
It obtains the list of directories to traverse using the
.Fl p
option of
.Xr man 1 .
.Pp
It supports the following options:
.Bl -tag -width indent
.It Fl C Ar path
Use different
.Xr man 1
configuration file than the default,
.Pa /etc/man.conf .
.It Fl f
Force rebuilding the index from scratch, pruning the existing one.
.It Fl l
Limit the parsing to only the NAME section of the pages.
This option can be used to mimic the behavior of the classic
.Xr apropos 1
and also to substantially save disk space.
.It Fl o
Use this option to optimize the index for faster search by
.Xr apropos 1
and also to significantly reduce disk space usage.
This is an expensive I/O operation.
.It Fl Q
Print only fatal error messages (i.e., when the database is left in
an inconsistent state and needs manual intervention).
.It Fl q
Print only warnings and error messages but no status updates.
.It Fl v
Enable verbose output.
This prints the name of every file being parsed
and a summary at the end of the index update.
.El
.Pp
The index generated by
.Nm
is also used by the
.Xr whatis 1
program, replacing the old
.Dq makewhatis
program.
.Ss DATABASE SCHEMA
The name of the FTS table is mandb and its schema is as follows:
.Bl -column -offset indent "Column Name" "Column Description"
.It Li section Ta The section number of the page
.It Li name Ta The name of the page from the NAME section.
.It Li name_desc Ta The one line description from the NAME section.
.It Li desc Ta The DESCRIPTION section.
.It Li lib Ta The LIBRARY section.
.It Li return_vals Ta The RETURN VALUES section.
.It Li env Ta The ENVIRONMENT section.
.It Li files Ta The FILES section.
.It Li exit_status Ta The EXIT STATUS section.
.It Li diagnostics Ta The DIAGNOSTICS section.
.It Li errors Ta The ERRORS section.
.It Li md5_hash Ta MD5 checksum of the man page.
.It Li machine Ta The machine architecture (if any) for which the man
page is relevant.
.El
.Sh FILES
.Bl -hang -width /etc/man.conf -compact
.It Pa /etc/man.conf
The location of the Sqlite FTS database can be configured using the
.Cd _mandb
tag.
.El
.Sh SEE ALSO
.Xr apropos 1 ,
.Xr man 1 ,
.Xr whatis 1 ,
.Xr mandoc 3 ,
.Xr man.conf 5
.Sh AUTHORS
.An Abhinav Upadhyay