TRUEPRINT(1)

trueprint(1) β€” straight outta the User Manual, and ngl bestie, this one is a whole personality πŸ’…βœ¨

πŸŽ€ NAME πŸŽ€

trueprint β€” print program listings on postscript printer. πŸ–¨οΈπŸ’–

🌸 SYNOPSIS 🌸

trueprint [ options ] [ files ]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so trueprint is a general purpose program printing program. it literally tries to produce everything that anybody could ever need in a program printout, and it does it without making you wrangle a million switches or build some cursed pipeline. it's giving "one command, full fantasy" ✨

as of right now it can handle: C, C++, Java, Perl, Verilog, shell (including ksh), Pascal, pseudo C, report files (that's the trueprint report file β€” see the NOTES), listing files, and text files.

every page in the output gets a default header made of the date or a user-defined string, plus the current function name, plus the overall page number (which is what the indexes use). and a footer made of the date, the current file name and the page number within that file, and the overall page number. and if the language has the concept of braces, trueprint will drop a braces depth count in the left-hand margin. iconic behavior honestly. 🫢

the printout has two function indexes at the front β€” one is an alphabetical list of all the functions, and the other is a list of files with the functions in each file, in alphabetical order. the first one gets suppressed if there are no functions, and the second gets suppressed if there's only one file. (no filler content, we love that for us. ✨)

if you don't specify a language on the command line, the options just default to whatever suits the first file you named on the command line. the filetype comes from the suffix β€” valid suffixes are:

  • C β€” suffixes .c .h β€” language option -language=c
  • C++ β€” suffixes .cxx .cpp .cc .C .hpp .H β€” language option -langauge=cxx
  • Java β€” suffix .java β€” language option -language=java
  • Shell β€” suffix .sh β€” language option -language=sh
  • Perl β€” suffix .pl β€” language option -language=perl
  • Pascal β€” suffix .pas β€” language option -language=pascal
  • Verilog β€” suffix .v β€” language option -language=v
  • Pseudo C β€” suffixes .pc .ph β€” language option -language=pseudoc
  • Report format β€” suffix .rep β€” language option -language=report
  • Listing β€” suffix .lst β€” language option -language=list
  • Plain Text β€” default β€” language option -language=text

when trueprint starts up, it pulls from four sets of options:

  1. Hard-coded defaults
  2. Language-specific defaults
  3. Options taken from the environment variable $TP_OPTS
  4. Command-line options

each set overrides the ones before it, so command-line options override literally everything else. periodt. πŸ‘‘

and if you wanna set up some personal default options? just set the environment variable $TP_OPTS and you're done, bestie. πŸŽ€


πŸ’– OPTIONS πŸ’–

✨ Miscellaneous Options ✨

  • -D <string>, --debug=<string> β€” set debug options to <string> (peep USAGE for what <string> actually is).
  • -O <string>, --diff=<string> β€” if <string> is a file, print the diffs between <string> and the input file; otherwise use it as a prefix and print diffs. See USAGE for more on how to actually use this.
  • -t <string>, --language=<string> β€” treat the input as this language. use --help=language for the list. 🌈
  • -U <string>, --username=<string> β€” set the username for the coversheet.
  • -H, --help[=<string>] β€” type out help info, and if you give it the <string> option it lists options for these topics:
    • all-options β€” all options
    • misc-options β€” miscellaneous options
    • page-furniture-options β€” page furniture options
    • text-format-options β€” text formatting options
    • print-options β€” options that select what to print
    • page-format-options β€” page format options
    • output-options β€” options affecting output
    • language β€” languages
    • prompt β€” format for --print-pages string
    • debug β€” format for --debug string
    • header β€” format for header & footer strings
    • report β€” file format for --language=report input
    • environment β€” environment vars used
  • -V, --version β€” type out version information. 🩷
  • -N, --use-environment β€” use environment variables.
  • --N, --ignore-environment β€” don't use values from the environment, like time, $USER, etc. this is for test purposes, so test results come out more reproducible. πŸ§ͺ
  • -R 1, --ps-level-one β€” use level one postscript.
  • -R 2, --ps-level-two β€” use level two postscript.

🌸 Text Formatting 🌸

  • -b, --no-page-break-after-function β€” don't print page breaks at the end of functions.
  • --b, --page-break-after-function β€” print page breaks at the end of functions.
  • -W, --no-intelligent-line-wrap β€” wrap lines at exactly the line-wrap column.
  • --W, --intelligent-line-wrap β€” wrap lines intelligently at significant characters, like a space.
  • -L <number>, --minimum-line-length=<number> β€” the minimum line length that intelligent line wrap will allow (default 10).
  • -T <number>, --tabsize=<number> β€” set the tabsize (default 8).
  • -E, --ignore-form-feeds β€” don't expand form feed characters into a new page.
  • --E, --form-feeds β€” expand form feed characters into a new page.
  • -p <number>, --point-size=<number> β€” specify the point size (default 10).
  • -g <number>, --leading=<number> β€” specify the interline gap in points (default 1).
  • -w <number>, --line-wrap=<number> β€” specify the line-wrap column.
  • --no-line-wrap β€” turn off line-wrap entirely.
  • -l <number>, --page-length=<number> β€” specify how many lines are on a page; the point size gets calculated appropriately.

πŸŽ€ Page Formatting πŸŽ€

  • -I, --no-holepunch β€” don't leave space for holepunch at the side of each page.
  • --I, --holepunch β€” leave space for holepunch at the side of each page.
  • -J, --no-top-holepunch β€” don't leave space for holepunch at the top of each page.
  • --J, --top-holepunch β€” leave space for holepunch at the top of each page.
  • -o p, --portrait β€” print using portrait orientation.
  • -o l, --landscape β€” print using landscape orientation.
  • -S 1, --single-sided β€” print single-sided.
  • -S 2, --double-sided β€” print double-sided.
  • -1, --one-up β€” print 1-on-1 (this is the default).
  • -2, --two-up β€” print 2-on-1.
  • -3, --two-tall-up β€” print 2-on-1 at 4-on-1 pointsize.
  • -4, --four-up β€” print 4-on-1.

πŸ’… Page Furniture πŸ’…

  • -X <string>, --left-header=<string> β€” specify the string for the left side of the header.
  • -x <string>, --left-footer=<string> β€” specify the string for the left side of the footer.
  • -Y <string>, --center-header=<string> β€” specify the string for the center of the header.
  • -y <string>, --center-footer=<string> β€” specify the string for the center of the footer.
  • -Z <string>, --right-header=<string> β€” specify the string for the right side of the header.
  • -z <string>, --right-footer=<string> β€” specify the string for the right side of the footer.
  • -m <string>, --message=<string> β€” a message to be printed over the page. it gets printed in a very large, light gray font, so it's giving watermark energy. there are a few escapes you can use as a replacement for <string> β€” see USAGE for more info. πŸ‘€
  • -G <number>, --gray-bands=<number> β€” emulate that old lineprinter paper with gray bands across each page. the <number> gives the width of the bands and the gaps between them.
  • -K, --headers β€” include the header on each page.
  • --K, --no-headers β€” suppress the header on each page.
  • -k, --footers β€” include the footer on each page.
  • --k, --no-footers β€” suppress the footer on each page.
  • -u, --page-furniture-lines β€” draw lines around the header & footer boxes and down the left side of the page.
  • --u, --no-page-furniture-lines β€” don't draw lines around the header & footer boxes or down the left side of the page.
  • -i, --no-braces-depth β€” exclude the braces depth count.
  • --i, --braces-depth β€” include the braces depth count.
  • -n, --no-line-numbers β€” exclude the line number count.
  • --n, --line-numbers β€” include the line number count.

πŸ–¨οΈ Output Options πŸ–¨οΈ

by default, trueprint sends the postscript output to lp or lpr, and it explicitly sets the destination to the value of the environment variable $PRINTER. so that's your default pipeline, bestie. πŸ’Œ

  • -d <string>, --printer=<string> β€” use printer <string>.
  • -P <string>, --printer=<string> β€” use printer <string>.
  • -s <string>, --output=<string> β€” send output to filename <string>; use - for stdout.
  • -r, --redirect-output β€” redirect output to a .ps file named after the first filename.
  • --r, --no-redirect-output β€” don't redirect output.
  • -c <number>, --copies=<number> β€” specify how many copies get printed.
  • -C, --no-cover-sheet β€” don't print a cover sheet.
  • --C, --cover-sheet β€” print a cover sheet.
  • -A <selection>, --print-pages=<selection> β€” specify the list of pages to be printed (see USAGE for what <selection> is).
  • -a, --no-prompt β€” don't prompt for each page about whether it should be printed or not.
  • --a, --prompt β€” prompt for each page about whether it should be printed or not.
  • -F, --no-file-index β€” don't print the file index.
  • --F, --file-index β€” print the file index.
  • -f, --no-function-index β€” don't print the function index.
  • --f, --function-index β€” print the function index.
  • -B, --no-print-body β€” don't print the body of text.
  • --B, --print-body β€” print the body of text.

we are SO not done here β€” there's more of this page coming, don't go anywhere bestie πŸ’–

πŸ’– USAGE πŸ’–

πŸ› the -D / --debug situation

okay so bestie, the -D <string> / --debug=<string> thing works like this:

every single letter flips on a whole lil family of debugging messages, and the digit sitting next to it is the level β€” 1 means the least messages, 9 means ALL the messages. and the letter @? that one turns on every area at once, so --debug=@9 is literally the "give me everything" button. if you wanna know which letter does which area, run --help=debug and it will spill the whole tea. ✨

ngl this feature is not uniformly implemented β€” messages were only typically added where they were needed. also, plot twist: messages will not be generated in code prior to the code that sets the debug string! so set that string early, bestie. 🫢

πŸ” the -O / --diff situation

for -O <string> / --diff=<string>, here's the vibe:

you hand over the old version of your file(s) with --diff=<pathname>. if <pathname> with the current filename stuck on the end is a valid file, then it shows you the differences between <pathname>/<filename>. or alternatively, if <pathname> is itself a file and you're only printing one file, then you get the differences between <pathname> and the current file. iconic. examples? say less:

trueprint --diff=../old- this.c that.c

that one prints the differences between ../old-this.c and this.c, and ../old-that.c and that.c.

trueprint --diff=../old/ this.c that.c

that one prints the differences between ../old/this.c and this.c, and ../old/that.c and that.c. and the trailing / is important, do not skip it. πŸ™ˆ

trueprint --diff=this.c that.c

and that one prints the differences between this.c and that.c. slay.


πŸ“„ the -A / --print-pages situation

for -A <selection> / --print-pages=<selection>, your <selection> is a comma-separated list of page selections, and here's the whole menu:

  • <number> β€” print that specific page
  • <number>-<number> β€” print all the pages between, and including, the specified pages
  • <function-name> β€” print all pages that include function-name
  • d β€” print all pages that have changed (only useful with the --diff option above πŸ‘€)
  • D β€” print all pages containing functions that have changed (also only useful with --diff above)
  • f β€” print the function index
  • F β€” print the file index

like, for example:

--print-pages=1-5,main,f

that will print the function index, pages 1 to 5, and all the pages for the function main. no notes. πŸ’…


πŸ’¬ the --prompt tea

if you specify --prompt then trueprint will literally ask you about each page, one by one, whether or not it should print that page. it gives you the deets β€” current filename, current functionname, page number, etc. β€” and here are all the responses you can throw back at it:

  • y β€” print this page
  • y<number> β€” print number pages
  • y* β€” print all the remaining pages
  • n β€” skip this page
  • n<number> β€” skip number pages
  • n* β€” skip all the remaining pages
  • p<selection> β€” print all remaining pages that match selection, where selection is in the format defined above
  • ? β€” print a help message

πŸ“ the --message escapes

the --message=<string> option takes a few % escapes inside <string>, and here they all are:

  • %% β€” print a simple %
  • %m β€” print the current month of the year as a number, e.g. 05
  • %d β€” print the current day of the month, e.g. 01
  • %y β€” print the current year, e.g. 1999
  • %D β€” print the date in the format mm/dd/yy
  • %L β€” print the date and time in long format, e.g. Fri Oct 8 11:49:51 1999
  • %c β€” print the last modified date of the current file in the format mm/dd/yy
  • %C β€” print the last modified date and time of the current file in long format, e.g. Fri Oct 8 11:49:51 1999
  • %H β€” print the current hour
  • %M β€” print the current minute
  • %S β€” print the current second
  • %T β€” print the time in the format HH:MM:SS
  • %j β€” print the day of the year, e.g. 095
  • %w β€” print the day of the week, e.g. Sunday
  • %a β€” print the abbreviated day of the week, e.g. Sun
  • %h β€” print the abbreviated month name, e.g. Mar
  • %r β€” print the time in am/pm notation, e.g. 10:45pm
  • %p β€” print the page number in the current file
  • %P β€” print the overall page number
  • %f β€” print the total number of pages of the current file
  • %F β€” print the total number of pages
  • %n β€” print the current filename
  • %N β€” print the current function name
  • %l β€” print the username of the current user

and the default values are, drumroll please πŸ₯:

  • left-header β€” %L
  • center-header β€” %N
  • right-header β€” Page %P of %F
  • left-footer β€” %L
  • center-footer β€” %n %p
  • right-footer β€” Page %P of %F

🌸 NOTES 🌸

for most of the languages, trueprint uses the language itself to figure out where the comments live (so it can print them in italics) and where the function names live (so it can print them in bold and pop them into the function index). cute, right? but some languages get extra special treatment:

Pseudo C is like C, except it has a way more forgiving syntax. in particular it ignores strings, so if you leave off a closing quote then pseudo C will still print out using a vaguely sensible format. it's intended for printing code that doesn't even compile yet β€” we've all been there. 😭

Listing format assumes very wide lines and a fixed page length of sixty-six characters, so it turns off line-wrap and sets the page length appropriately.

Report format uses a few special characters: anything between ^A and ^E gets printed in bold and included in the function index, and anything between a pair of ^Cs gets printed in italics. ✨


🌈 ENVIRONMENT 🌈

by default Trueprint uses environment variables and the current username. here's the whole squad:

  • PRINTER β€” specify the printer to use when sending postscript output to the printer.
  • TP_OPTS β€” specify options. these options override any default options including language defaults, but they get overridden by command line options. so command line stays winning, periodt.
  • TP_DIFF_CMD β€” specify the diff command to be used. the command must produce output in the same format as the classic Unix diff. you can use this variable to add flags to the diff command used, for example to make diff ignore whitespace.
  • TP_PRINT_CMD β€” specify the print command. the default is lpr. if this is set then it should be set to a command that takes standard input. and heads up: if this is set then the destination and number of copies have no effect, i.e. there is no mechanism to pass these values to your print command. oh and if you set this to /bin/cat then the postscript output will appear on stdout. πŸ‘‘
  • TP_PRINTERS_FILE β€” specify the printers file. the default is the printers file that was initially configured when trueprint was installed. you can use this to test out a new printers file.

🫢 AUTHOR 🫢

the program was written by Lezz Giles. please send bug reports to bug-trueprint@gnu.org and ideas for enhancement or similar things to enhance-trueprint@gnu.org. the manpage was written by Othmar Pasteka othmar@tron.at.


okay bestie that's the whole page!! this one's from GNU, dated 7. 1. 2000, and it's TRUEPRINT(1) β€” go forth and print pretty code, you absolute icon πŸ’…πŸ’–