OS Manuals

/usr/bin/ppx-base-4

ppx_base ppx rewriter (Jane Street)

From ocaml4-ppx-base 0.16.0-r6 (enterprise-packages), captured 2026-11-08 by running ppx-base-4 --help (exit 0). permalink

ppx-base [extra_args] [<files>]
  -as-ppx                      Run as a -ppx rewriter (must be the first argument)
  --as-ppx                     Same as -as-ppx
  -as-pp                       Shorthand for: -dump-ast -embed-errors
  --as-pp                      Same as -as-pp
  -o <filename>                Output file (use '-' for stdout)
  -                            Read input from stdin
  -dump-ast                    Dump the marshaled ast to the output file instead of pretty-printing it
  --dump-ast                   Same as -dump-ast
  -dparsetree                  Print the parsetree (same as ocamlc -dparsetree)
  -embed-errors                Embed errors in the output AST (default: true when -as-pp, false otherwise)
  -null                        Produce no output, except for errors
  -impl <file>                 Treat the input as a .ml file
  --impl <file>                Same as -impl
  -intf <file>                 Treat the input as a .mli file
  --intf <file>                Same as -intf
  -debug-attribute-drop        Debug attribute dropping
  -print-transformations       Print linked-in code transformations, in the order they are applied
  -print-passes                Print the actual passes over the whole AST in the order they are applied
  -ite-check                   (no effect -- kept for compatibility)
  -pp <command>                Pipe sources through preprocessor <command> (incompatible with -as-ppx)
  -reconcile                   (WIP) Pretty print the output using a mix of the input source and the generated code
  -reconcile-with-comments     (WIP) same as -reconcile but uses comments to enclose the generated code
  -no-color                    Don't use colors when printing errors
  -diff-cmd                    Diff command when using code expectations (use - to disable diffing)
  -pretty                      Instruct code generators to improve the prettiness of the generated code
  -styler                      Code styler
  -output-metadata FILE        Where to store the output metadata
  -corrected-suffix SUFFIX     Suffix to append to corrected files
  -keywords <version+list>     Set keywords according to the version+list specification. Allows using a set of keywords different from the one of the current compiler for backward compatibility.
  --keywords <version+list>    Same as -keywords
  --use-compiler-pp Force      migrating the AST back to the compiler's version before printing it as source code using the compiler's Pprintast utilities.
  -loc-filename <string>       File name to use in locations
  -reserve-namespace <string>  Mark the given namespace as reserved
  -no-check                    Disable checks (unsafe)
  -check                       Enable checks
  -no-check-on-extensions      Disable checks on extension point only
  -check-on-extensions         Enable checks on extension point only
  -no-locations-check          Disable locations check only
  -locations-check             Enable locations check only
  -apply <names>               Apply these transformations in order (comma-separated list)
  -dont-apply <names>          Exclude these transformations
  -no-merge                    Do not merge context free transformations (better for debugging rewriters). As a result, the context-free transformations are not all applied before all impl and intf.
  -cookie NAME=EXPR            Set the cookie NAME to EXPR
  --cookie                     Same as -cookie
  -deriving-keep-w32 {impl|intf|both}
                               Do not try to disable warning 32 for the generated code
  -deriving-disable-w32-method {code|attribute}
                               How to disable warning 32 for the generated code
  -type-conv-keep-w32 {impl|intf|both}
                               Deprecated, use -deriving-keep-w32
  -type-conv-w32 {code|attribute}
                               Deprecated, use -deriving-disable-w32-method
  -deriving-keep-w60 {impl|intf|both}
                               Do not try to disable warning 60 for the generated code
  -unused-code-warnings {true|false|force}
                               Allow ppx derivers to enable unused code warnings (default: false)
  -unused-type-warnings {true|false|force}
                               Allow unused type warnings for types with [@@deriving ...] (default: false)
  -help                        Display this list of options
  --help                       Display this list of options
Options (52)
OptionDescriptionSource
-as-ppxRun as a -ppx rewriter (must be the first argument)help
--as-ppxSame as -as-ppxhelp
-as-ppShorthand for: -dump-ast -embed-errorshelp
--as-ppSame as -as-pphelp
-o filenameOutput file (use '-' for stdout)help
-dump-astDump the marshaled ast to the output file instead of pretty-printing ithelp
--dump-astSame as -dump-asthelp
-dparsetreePrint the parsetree (same as ocamlc -dparsetree)help
-embed-errorsEmbed errors in the output AST (default: true when -as-pp, false otherwise)help
-nullProduce no output, except for errorshelp
-impl fileTreat the input as a .ml filehelp
--impl fileSame as -implhelp
-intf fileTreat the input as a .mli filehelp
--intf fileSame as -intfhelp
-debug-attribute-dropDebug attribute droppinghelp
-print-transformationsPrint linked-in code transformations, in the order they are appliedhelp
-print-passesPrint the actual passes over the whole AST in the order they are appliedhelp
-ite-check(no effect -- kept for compatibility)help
-pp commandPipe sources through preprocessor <command> (incompatible with -as-ppx)help
-reconcile(WIP) Pretty print the output using a mix of the input source and the generated codehelp
-reconcile-with-comments(WIP) same as -reconcile but uses comments to enclose the generated codehelp
-no-colorDon't use colors when printing errorshelp
-diff-cmdDiff command when using code expectations (use - to disable diffing)help
-prettyInstruct code generators to improve the prettiness of the generated codehelp
-stylerCode stylerhelp
-output-metadata FILEWhere to store the output metadatahelp
-corrected-suffix SUFFIXSuffix to append to corrected fileshelp
-keywords version+listSet keywords according to the version+list specification.help
--keywords version+listSame as -keywordshelp
--use-compiler-pp Forcemigrating the AST back to the compiler's version before printing it as source code using the compiler's Pprintast utilities.help
-loc-filename stringFile name to use in locationshelp
-reserve-namespace stringMark the given namespace as reservedhelp
-no-checkDisable checks (unsafe)help
-checkEnable checkshelp
-no-check-on-extensionsDisable checks on extension point onlyhelp
-check-on-extensionsEnable checks on extension point onlyhelp
-no-locations-checkDisable locations check onlyhelp
-locations-checkEnable locations check onlyhelp
-apply namesApply these transformations in order (comma-separated list)help
-dont-apply namesExclude these transformationshelp
-no-mergeDo not merge context free transformations (better for debugging rewriters).help
-cookie NAME=EXPRSet the cookie NAME to EXPRhelp
--cookieSame as -cookiehelp
-deriving-keep-w32 impl|intf|bothDo not try to disable warning 32 for the generated codehelp
-deriving-disable-w32-method code|attributeHow to disable warning 32 for the generated codehelp
-type-conv-keep-w32 impl|intf|bothDeprecated, use -deriving-keep-w32help
-type-conv-w32 code|attributeDeprecated, use -deriving-disable-w32-methodhelp
-deriving-keep-w60 impl|intf|bothDo not try to disable warning 60 for the generated codehelp
-unused-code-warnings true|false|forceAllow ppx derivers to enable unused code warnings (default: false)help
-unused-type-warnings true|false|forceAllow unused type warnings for types with [@@deriving ...] (default: false)help
-helpDisplay this list of optionshelp
--helpDisplay this list of optionshelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.