NetBSD/usr.bin/vgrind/vgrind.1

227 lines
5.5 KiB
Groff
Raw Permalink Normal View History

.\" $NetBSD: vgrind.1,v 1.16 2012/04/21 12:27:30 roy Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
1993-04-09 16:58:42 +04:00
.\"
.\" 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.
.\" 3. Neither the name of the University nor the names of its contributors
1993-04-09 16:58:42 +04:00
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
.\"
.\" @(#)vgrind.1 8.1 (Berkeley) 6/6/93
1993-04-09 16:58:42 +04:00
.\"
.Dd April 5, 2012
1993-04-09 16:58:42 +04:00
.Dt VGRIND 1
.Os
1993-04-09 16:58:42 +04:00
.Sh NAME
.Nm vgrind
.Nd grind nice listings of programs
.Sh SYNOPSIS
.Nm
.Op Fl fntWx
1993-04-09 16:58:42 +04:00
.Op Fl d Ar file
.Op Fl h Ar header
.Op Fl l Ar language
.Op Fl s Ns Ar n
.Op Fl
1999-03-07 14:29:58 +03:00
.Ar
1993-04-09 16:58:42 +04:00
.Sh DESCRIPTION
.Nm
formats the program sources which are arguments
1993-04-09 16:58:42 +04:00
in a nice style using
.Xr troff 1 .
1993-04-09 16:58:42 +04:00
Comments are placed in italics, keywords in bold face,
and the name of the current function is listed down the margin of each
page as it is encountered.
.Pp
.Nm
1993-04-09 16:58:42 +04:00
runs in two basic modes, filter mode (see the
.Fl f
2002-09-30 15:08:56 +04:00
option) or regular mode.
In filter mode
.Nm
1993-04-09 16:58:42 +04:00
acts as a filter in a manner similar to
.Xr tbl 1 .
The standard input is passed directly to the standard output except
for lines bracketed by the
1993-04-09 16:58:42 +04:00
.Em troff-like
macros:
.Bl -tag -width Ds
.It \&.vS
starts processing
.It \&.vE
ends processing
.El
.Pp
2002-09-30 15:08:56 +04:00
These lines are formatted as described above.
The output from this filter can be passed to
.Xr troff 1
2002-09-30 15:08:56 +04:00
for output.
There need be no particular ordering with
1993-04-09 16:58:42 +04:00
.Xr eqn 1
or
.Xr tbl 1 .
.Pp
In regular mode
.Nm
accepts input files, processes them, and passes them to
1993-04-09 16:58:42 +04:00
.Xr troff 1
for output.
1993-04-09 16:58:42 +04:00
.Pp
In both modes
.Nm
1993-04-09 16:58:42 +04:00
passes any lines beginning with a decimal point without conversion.
.Pp
The options are:
.Bl -tag -width Ar
.It Fl
1993-04-09 16:58:42 +04:00
forces input to be taken from standard input (default if
.Fl f
is specified )
.It Fl d Ar file
1997-03-08 17:13:54 +03:00
specifies an alternative language definitions
1993-04-09 16:58:42 +04:00
file (default is
.Pa /usr/share/misc/vgrindefs )
.It Fl f
forces filter mode
.It Fl h Ar header
specifies a particular header to put on every output page (default is
the file name)
.It Fl l
2002-09-30 15:08:56 +04:00
specifies the language to use.
Currently known are
1993-04-09 16:58:42 +04:00
.Tn PASCAL
.Pq Fl l Ns Ar p ,
.Tn MODEL
.Pq Fl l Ns Ar m ,
C
.Pf ( Fl l Ns Ar c
or the default),
.Tn CSH
.Pq Fl l Ns Ar csh ,
.Tn SHELL
.Pq Fl l Ns Ar sh ,
.Tn RATFOR
.Pq Fl l Ns Ar r ,
.Tn MODULA2
.Pq Fl l Ns Ar mod2 ,
.Tn YACC
.Pq Fl l Ns Ar yacc ,
.Tn LISP
.Pq Fl l Ns Ar isp ,
and
.Tn ICON
.Pq Fl l Ns Ar I .
.It Fl n
forces no keyword bolding
.It Fl s Ns Ar n
specifies a point size
.Ar n
to use on output (exactly the same as the argument
1993-04-09 16:58:42 +04:00
of a .ps)
.It Fl t
similar to the same option in
.Xr troff 1
1993-04-09 16:58:42 +04:00
causing formatted text to go to the standard output
.It Fl W
forces output to the (wide) Versatec printer rather than the (narrow)
Varian
1993-04-09 16:58:42 +04:00
.It Fl x
outputs the index file in a ``pretty'' format.
The index file itself is produced whenever
.Nm
is run with a file called
1993-04-09 16:58:42 +04:00
.Pa index
in the current directory.
The index of function
definitions can then be run off by giving
.Nm
1993-04-09 16:58:42 +04:00
the
.Fl x
option and the file
.Pa index
as argument.
.El
.Sh FILES
.Bl -tag -width /usr/share/misc/vgrindefsxx -compact
.It Pa index
file where source for index is created
.It Pa /usr/share/tmac/vgrind.tmac
1993-04-09 16:58:42 +04:00
macro package
.It Pa /usr/libexec/vfontedpr
preprocessor
.It Pa /usr/share/misc/vgrindefs
language descriptions
.El
.Sh SEE ALSO
.Xr lpr 1 ,
.Xr troff 1 ,
.Xr getcap 3 ,
1993-04-09 16:58:42 +04:00
.Xr vgrindefs 5
2001-12-08 22:22:17 +03:00
.Sh HISTORY
The
.Nm
command appeared in
.Bx 3.0 .
1993-04-09 16:58:42 +04:00
.Sh BUGS
Vfontedpr assumes that a certain programming style is followed:
.Pp
For
1993-04-09 16:58:42 +04:00
.Tn C
\- function names can be preceded on a line only by spaces, tabs, or an
2002-09-30 15:08:56 +04:00
asterisk.
The parenthesized arguments must also be on the same line.
1993-04-09 16:58:42 +04:00
.Pp
For
.Tn PASCAL
\- function names need to appear on the same line as the keywords
.Em function
or
.Em procedure .
.Pp
For
.Tn MODEL
\- function names need to appear on the same line as the keywords
.Em is beginproc .
.Pp
If these conventions are not followed, the indexing and marginal function
name comment mechanisms will fail.
.Pp
More generally, arbitrary formatting styles for programs mostly look bad.
The use of spaces to align source code fails miserably; if you plan to
.Nm
2002-09-30 15:08:56 +04:00
your program you should use tabs.
This is somewhat inevitable since the font used by
.Nm
1993-04-09 16:58:42 +04:00
is variable width.
.Pp
The mechanism of
.Xr ctags 1
in recognizing functions should be used here.
.Pp
Filter mode does not work in documents using the
.Fl me
or
.Fl ms
macros.
(So what use is it anyway?)