CPPO(1)
π CPPO β the manual, but make it cute π
okay bestie, welcome to the cppo page from the User Manuals section, like a little corner of the manual universe that is entirely about making your OCaml life easier. grab a snack, we're doing this π
β¨ NAME β¨
cppo β the lightweight, cpp-like preprocessor for OCaml. yes that's her whole government name π«Ά
π¦ SYNOPSIS π¦
cppo [Options...] files...
that's it. that's the whole vibe. options, then files, no cap β¨
πΈ DESCRIPTION πΈ
so basically cppo is the C preprocessor but for OCaml, and it understood the assignment π
It lets you define and expand simple macros β "simple" compared to camlp4, which is doing the absolute most β plus file inclusion. so iconic.
and she doesn't stop there. cppo supports functional macros, conditionals, boolean and arithmetic expressions, stringification, and even calling different, external preprocessors. she's multifaceted, she contains multitudes, main character energy fr fr π
for the precise, granular, every-last-detail description of all the features, go read /usr/share/doc/cppo/README.gz. that's the deep lore bestie π
π OPTIONS π
-D IDENTβ defineIDENT. give it a name, she'll remember it π-U IDENTβ undefineIDENT. it's giving "we don't know her" π-I DIRβ addDIRto the search path for included files. she needs to know where to look π-o FILEβ write output toFILE. otherwise she just says it out loud to stdout, which is also valid-qβ Identify and preserve camlp4 quotations. leave them exactly as you found them, respect β¨-sβ Output line directives pointing to the exact source location of each token, including those coming from the body of macro definitions. This behavior is off by default. turn it on if you want receipts π§Ύ-nβ Do not output any line directive other than those found in the input. heads up: this overrides-sπ-versionβ print version and exit. quick little hello and goodbye π-x NAME:CMD_TEMPLATEβ Define a custom preprocessor target section. it starts with:
#ext "NAME"
and ends with:
#endext
NAME must be a lowercase identifier of the form [a-z][A-Za-z0-9_]* β no uppercase debuts, she has rules π
CMD_TEMPLATE is a command template supporting the following special sequences:
%Fβ file name (unescaped; beware of potential scripting attacks π yes this is the scary one, please be careful)%Bβ number of the first line%Eβ number of the last line%%β a single percent sign
The filename, the first line number and the last line number are available to the external preprocessor via the environment variables CPPO_FILE, CPPO_FIRST_LINE, CPPO_LAST_LINE π
The command is expected to read from stdin and to write to stdout. that's the whole contract, periodt π«Ά
-help|--helpβ Display options and exit. when in doubt, ask her directly π
π SEE ALSO π
- the cppo web page,
http://mjambon.com/cppo.htmlβ go say hi β¨ - the text manual in
/usr/share/doc/cppo/README.gzβ the full dissertation, as promised π
π AUTHOR π
This manual page was written by Sylvain Le Gall <gildor@debian.org> and Hendrik Tews <hendrik@askra.de>, specifically for the Debian project (and may be used by others). legends, honestly, we thank them for their service π«Άπ
and that's the whole page bestie!! this was CPPO in the CPPO(1) era, version vibes from June 2013 πΈ you ate that, now go preprocess something iconic π
β¨
π¦ where this page comes from
- debian bookworm: cppo 1.6.9-1 Β· BSD-3-Clause
- debian trixie: cppo 1.8.0-1+b2 Β· BSD-3-Clause
- ubuntu jammy: cppo 1.6.8-1build1 Β· BSD-3-Clause
- ubuntu noble: cppo 1.6.9-3build1 Β· BSD-3-Clause
- ubuntu questing: cppo 1.8.0-1build2
- ubuntu resolute: cppo 1.8.0-1build4 Β· BSD-3-Clause
- ubuntu stonking: cppo 1.8.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms