On Unix-like operating systems, the vgrind command “grinds” program listings, creating a more appealing output format.
Description
The vgrind utility formats the program sources named by the filename arguments in a nice style using troff. Comments are placed in italics, keywords in bold face, and as each function is encountered its name is listed on the page margin.
- Description
- Syntax
- Examples
- Related commands
- Linux commands help
vgrind runs in two basic modes, filter mode or regular mode. In filter mode, vgrind acts as a filter in a manner similar to tbl. The standard input is passed directly to the standard output except for lines bracketed by the troff-like macros:
These lines are formatted as described above. The output from this filter can be passed to troff for output. There need be no particular ordering with eqn or tbl. In regular mode, vgrind accepts input file names, processes them, and passes them to troff for output. Use a hyphen (’-’) to specify standard input; otherwise, vgrind will exit without attempting to read from the standard input. File names must be specified after all other option arguments.
In regular mode, if the -t or -P option is specified, the output is:
- emitted (in troff format) to stdout if the -t option is specified.
- printed (as PostScript) to the named printer if the -P option is specified.
Otherwise, the output is:
- printed (as PostScript) on the system default printer, if one is defined, and the command’s stdout is a tty.
- emitted (as PostScript) to stdout if it’s not a tty (that is, if stdout is a pipe or a redirect to a file).
In both modes, vgrind passes any lines beginning with a decimal point without conversion.
Syntax
vgrind [-2] [-f] [-n] [-t] [-w] [-W] [-x] [-d defs-file] [ -h header] [-l language] [-s n] [-o pagelist] [ -P printer] [-T output-device] filename
Options
Examples
vgrind -t myfile.c | lpr -t
print a formatted listing of the program file myfile.c.
Related commands
csh — The C shell command interpreter.ctags — Create tag files for source code.eqn — Language processor for describing equations.tbl — Preprocessor which formats tables for nroff or troff.troff — Typeset or format documents for terminal display or line-printer.