Must distinguish between "ambiguous" and "unknown" commands.
[unix-history] / usr / src / usr.bin / vgrind / vgrind.1
CommitLineData
9005ce62
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
6d2470eb 5.\" @(#)vgrind.1 6.2 (Berkeley) %G%
9005ce62 6.\"
284fb403 7.TH VGRIND 1 ""
9005ce62
KM
8.UC 4
9.SH NAME
10vgrind \- grind nice listings of programs
11.SH SYNOPSIS
12.B vgrind
13[
4a9bc47c
KM
14.B \-f
15] [
16.B \-
17] [
9005ce62
KM
18.B \-t
19] [
20.B \-n
21] [
22.B \-x
23] [
24.B \-W
25] [
9005ce62
KM
26.B \-sn
27] [
28.B \-h
29header
4a9bc47c
KM
30] [
31.B \-d
32file
33] [
34.BI \-l language
9005ce62
KM
35]
36name ...
37.SH DESCRIPTION
38.I Vgrind
4a9bc47c 39formats the program sources which are arguments
9005ce62 40in a nice style using
4a9bc47c
KM
41.IR troff (1)
42Comments are placed in italics, keywords in bold face,
9005ce62
KM
43and the name of the current function is listed down the margin of each
44page as it is encountered.
45.PP
4a9bc47c
KM
46.I Vgrind
47runs in two basic modes, filter mode or regular mode. In filter mode
48.I vgrind
49acts as a filter in a manner similar to
50.IR tbl (1).
51The standard input is passed directly to the standard output except
52for lines bracketed by the
53.I troff-like
54macros:
55.IP .vS
56- starts processing
57.IP .vE
58- ends processing
59.LP
60These lines are formatted as described above. The output from this
61filter can be passed to
62.I troff
63for output. There need be no particular ordering with
64.IR eqn (1)
65or
66.IR tbl (1).
9005ce62 67.PP
4a9bc47c
KM
68In regular mode
69.I vgrind
70accepts input files, processes them, and passes them to
9005ce62 71.IR troff (1)
4a9bc47c 72for output.
9005ce62 73.PP
4a9bc47c
KM
74In both modes
75.I vgrind
76passes any lines beginning with a decimal point without conversion.
77.PP
78The options are:
79.IP \fB\-f\fP
80forces filter mode
81.IP \fB\-\fP
82forces input to be taken from standard input (default if
83.B \fB\-f\fP
84is specified )
85.IP \fB\-t\fP
86similar to the same option in
87.I troff
88causing formatted text to go to the standard output
89.IP \fB\-n\fP
90forces no keyword bolding
91.IP \fB\-x\fP
92outputs the index file in a ``pretty'' format.
93The index file itself is produced whenever
9005ce62 94.I vgrind
4a9bc47c
KM
95is run with a file called
96.I index
97in the current directory.
98The index of function
99definitions can then be run off by giving
100.I vgrind
9005ce62
KM
101the
102.B \-x
103option and the file
104.I index
105as argument.
4a9bc47c
KM
106.IP \fB\-W\fP
107forces output to the (wide) Versatec printer rather than the (narrow)
108Varian
109.IP \fB\-s\fP
110specifies a point size to use on output (exactly the same as the argument
111of a .ps)
112.IP \fB\-h\fP
113specifies a particular header to put on every output page (default is
114the file name)
115.IP \fB\-d\fP
116specifies an alternate language definitions
117file (default is /usr/lib/vgrindefs)
118.IP \fB\-l\fP
119specifies the language to use. Currently known are PASCAL
120.RB ( \-lp ),
121MODEL
122.RB ( \-lm ), C
123.RB ( \-lc
124or the default), CSH
125.RB ( \-lcsh ),
126SHELL
127.RB ( \-lsh ),
128RATFOR
129.RB ( \-lr ),
284fb403
KM
130MODULA2
131.RB ( \-lmod2 ),
132YACC
133.RB ( \-lyacc ),
134ISP
135.RB ( \-lisp ),
4a9bc47c
KM
136and ICON
137.RB ( \-lI ).
9005ce62
KM
138.SH FILES
139.ta 2i
140index file where source for index is created
141.br
142/usr/lib/tmac/tmac.vgrind macro package
143.br
144/usr/lib/vfontedpr preprocessor
4a9bc47c
KM
145.br
146/usr/lib/vgrindefs language descriptions
9005ce62 147.SH AUTHOR
4a9bc47c 148Dave Presotto & William Joy
9005ce62 149.SH SEE ALSO
4a9bc47c
KM
150vlp(1),
151vtroff(1),
152vgrindefs(5)
9005ce62
KM
153.SH BUGS
154Vfontedpr assumes that a certain programming style is followed:
155.PP
156For
157.B C
4a9bc47c
KM
158\- function names can be preceded on a line only by spaces, tabs, or an
159asterisk. The parenthesized arguments must also be on the same line.
9005ce62
KM
160.PP
161For
162.B PASCAL
4a9bc47c 163\- function names need to appear on the same line as the keywords
9005ce62 164.I function
4a9bc47c 165or
9005ce62 166.I procedure.
9005ce62
KM
167.PP
168For
169.B MODEL
4a9bc47c 170\- function names need to appear on the same line as the keywords
9005ce62
KM
171.I is
172.I beginproc.
173.PP
174If these conventions are not followed, the indexing and marginal function
175name comment mechanisms will fail.
176.sp
177More generally, arbitrary formatting styles for programs mostly look bad.
178The use of spaces to align source code fails miserably; if you plan to
179.I vgrind
180your program you should use tabs. This is somewhat inevitable since the
181font used by
182.I vgrind
183is variable width.
184.PP
9005ce62 185The mechanism of ctags in recognizing functions should be used here.
6d2470eb
KM
186.PP
187Filter mode does not work in documents using the \-me or \-ms macros.
188(So what use is it anyway?)