[BACK]Return to apropos.1 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.sbin / makemandb

File: [cvs.NetBSD.org] / src / usr.sbin / makemandb / apropos.1 (download)

Revision 1.8, Fri Mar 29 20:07:31 2013 UTC (10 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.7: +16 -5 lines

- If the stdout is not a tty, prevent formatting unless forced with -i
- Don't ever page unless asked for with -p
- Introduce "legacy mode" (-l)
  1. searches only name and name_desc, prints name(section) - name_description
  2. turns off escape formatting (can be forced on with -i)
  3. turns off context printing (can be forced on with -c)
- Parse the environment $APROPOS variable as an argument vector.

With these changes one can simply 'export APROPOS=-l' and get the old apropos
behavior.

.\" $NetBSD: apropos.1,v 1.8 2013/03/29 20:07:31 christos 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 March 29, 2013
.Dt APROPOS 1
.Os
.Sh NAME
.Nm apropos
.Nd search the complete content of all man pages
.Sh SYNOPSIS
.Nm
.Op Fl 123456789Ccilpr
.Op Fl n Ar Number of results
.Op Fl S Ar machine
.Op Fl s Ar section
.Ar query
.Sh DESCRIPTION
The
.Nm
utility performs a full text search over the complete content of all man pages.
It uses the FTS engine of Sqlite to perform the search.
The database is created with the help of
.Xr makemandb 8
utility.
.Pp
This implementation of the
.Nm
utility is more sophisticated than the classical version of
.Nm .
Like modern search applications, it uses advanced techniques like stemming
and term weighting to rank the matching results in decreasing order of
relevance.
By default
.Nm
will only display the top 10 matches in the output.
.Pp
Quotes are optional for specifying multiword queries.
.Pp
It supports the following options:
.Bl -tag -width indent
.It Fl 1
Search only within section 1 manual pages.
.It Fl 2
Search only within section 2 manual pages.
.It Fl 3
Search only within section 3 manual pages.
.It Fl 4
Search only within section 4 manual pages.
.It Fl 5
Search only within section 5 manual pages.
.It Fl 6
Search only within section 6 manual pages.
.It Fl 7
Search only within section 7 manual pages.
.It Fl 8
Search only within section 8 manual pages.
.It Fl 9
Search only within section 9 manual pages.
.It Fl C
Do not show the context of the match.
.It Fl c
Do show the context of the match (default).
.It Fl i
Turn on escape code formatting.
.It Fl l
Legacy mode: Only searches name and name description.
Does not print context, or escape format the text.
.It Fl n
Output up to the specified number of search results.
The default limit is infinity.
.It Fl p
Pipe the results through a pager (defaulting to
.Xr more 1 ) .
.It Fl r
On tty output don't issue any formatting escape codes.
.It Fl S Ar machine
Limit the search to the pages for the specified machine architecture.
By default pages for all architectures are shown in the search results.
.It Fl s Ar section
Restrict the search to the specified section of the manual.
By default, pages from all section are shown.
This option is for backwards compatibility with the classic version of apropos,
using it is equivalent to using the
.Op 123456789
options directly.
.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 ENVIRONMENT VARIABLES
The
.Dv APROPOS
environment variables is white-space tokenized as an argument vector
and the options in it are parsed and set.
Command line options override the environment options.
.Sh SEE ALSO
.Xr man 1 ,
.Xr whatis 1 ,
.Xr makemandb 8
.Sh HISTORY
The
.Nm
command appeared in 3.0BSD.
It was rewritten in
.Nx 6.0
to support full text search using Sqlite.
.Sh AUTHORS
.An Abhinav Upadhyay