VGRIND(1)
β¨ VGRIND(1) β¨
Hey bestie! This is VGRIND(1), from BSD System Compatibility β and it's literally all about grinding out the cutest listings of your programs π
πΈ NAME πΈ
vgrind β grind nice listings of programs β¨
π SYNOPSIS π
vgrind [-2ftnxw] [-sn] [-h header] [-d file] [-l language] [-P printer]
[-T device] [-o list] name ...
π DESCRIPTION π
Okay so vgrind formats the program sources you pass as arguments into a super nice style using troff(1). Comments go in italics, keywords go in bold face, and the name of the current function gets listed down the margin of every page as it's encountered. Iconic behavior, honestly π«Ά
vgrind runs in two basic modes: filter mode or regular mode.
In filter mode, vgrind acts as a filter kinda like tbl(1). Standard input gets passed directly to standard output except for lines bracketed by these troff-like macros:
.vSβ starts processing.vEβ ends processing
Those bracketed lines get formatted as described above. The output from this filter can be passed to troff for output. And there's no need for any particular ordering with eqn(1) or tbl(1) β no cap.
In regular mode, vgrind accepts input files, processes them, and passes them to troff(1) for output.
In both modes, vgrind passes any lines beginning with a decimal point without conversion π
β The Options
-2β produce two-column output, slay π-fβ forces filter mode-tβ similar to the same option introff, causing formatted text to go to the standard output-nβ forces no keyword bolding-xβ outputs the index file in a βprettyβ format. The index file itself is produced whenevervgrindis run with a file calledindexin the current directory. The index of function definitions can then be run off by givingvgrindthe-xoption and the fileindexas argument. So cute π-sβ specifies a point size to use on output (exactly the same as the argument of a.ps)-hβ specifies a particular header to put on every output page (default is the file name)-dβ specifies an alternate language definitions file (default is/usr/lib/vgrindefs)-lβ specifies the language to use. Currently known arePASCAL(-lp),MODEL(-lm),C(-lcor the default),C++(-lc++),CSH(-lcsh),SHELL(-lsh),RATFOR(-lr),MODULA2(-lmod2),YACC(-lyacc),ISP(-lisp), andICON(-lI). So many languages, we love a multilingual icon π-Pβ specifies that output is directed to the named printer-Tβ is passed totroffand specifies the device to use-oβ is passed totroffand specifies selected pages to print-wβ sets the size of tabulators to four instead of the default eight
π FILES π
indexβ file where source for index is created/usr/share/heirloom-doctools/tmac/vgrindβ macro package/usr/lib/heirloom-doctools/vfontedprβ preprocessor/usr/lib/heirloom-doctools/vgrindefsβ language descriptions
π SEE ALSO π
troff(1) β go check it out bestie, they're like this π€
β οΈ NOTES β οΈ
Okay so vfontedpr assumes a certain programming style is followed, and if you don't follow it, things get messy π
ForCandC++β function names can be preceded on a line only by spaces, tabs, or an asterisk. The parenthesized arguments must also be on the same line.
ForPASCALβ function names need to appear on the same line as the keywordsfunctionorprocedure.
ForMODELβ function names need to appear on the same line as the keywordsisbeginproc.
If these conventions are not followed, the indexing and marginal function name comment mechanisms will fail. So like, don't do that π
More generally, arbitrary formatting styles for programs mostly look bad. The use of spaces to align source code fails miserably; if you plan to vgrind your program you should use tabs. This is somewhat inevitable since the font used by vgrind is variable width. It's giving "aesthetic but make it functional" β¨
The mechanism of ctags in recognizing functions should be used here.
Filter mode does not work in documents using the-meor-msmacros. (So what use is it anyway?) π
Written by Dave Presotto & William Joy. Respect the OGs π
This page is from the 4th Berkeley Distribution, dated 11/6/05, and it's VGRIND(1) β periodt ππ
π¦ where this page comes from
- alpine 3.24: heirloom-doctools-doc 191015-r6 Β· CDDL-1.1
- Copyright (c) 1980 Regents of the University of California
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms