Title: Theory / Unimportant / CS / Programming / oCaml / Manual{ / 10 Top level;; / Options
Tags: computer_to_instruction fromCommandLine
On every note of this deck, unless a note says otherwise:
Page: https://caml.inria.fr/pub/docs/manual-ocaml/toplevel.html
Prefix: ocaml
Chapter: 10

Fla: -absname
Effect: Force error messages to show absolute paths for file names.

Fla: -args filename
Effect: Read additional newline-terminated command line arguments from filename. It is not possible to pass a scriptfile via file to the toplevel.

Fla: -args0 filename
Effect: Read additional null character terminated command line arguments from filename. It is not possible to pass a scriptfile via file to the toplevel.

Fla: -config
Effect: Print the version number of and a detailed summary of its configuration, then exit.

Page: https://caml.inria.fr/pub/docs/manual-ocaml/toplevel.html
Effect: Add the given directory to the list of directories searched for source and compiled files. By default, the current directory is searched first, then the standard library directory. Directories added with -I are searched after the current directory, in the order in which they were given on the command line, but before the standard library directory. See also option -nostdlib.\n If the given directory starts with +, it is taken relative to the standard library directory. For instance, -I +unix adds the subdirectory unix of the standard library to the search path. Directories can also be added to the list once the toplevel is running with the #directory directive (section 10.2).
Language: ocaml
Chapter: 10
Abbreviation: -I directory

Fla: -init file
Effect: Load the given file instead of the default initialization file. The default file is .ocamlinit in the current directory if it exists, otherwise .ocamlinit in the user’s home directory.

Fla: -labels
Effect: Labels are not ignored in types, labels may be used in applications, and labelled parameters can be given in any order. This is the default.

Fla: -no-app-funct
Effect: Deactivates the applicative behaviour of functors. With this option, each functor application generates new types in its result and applying the same functor twice to the same argument yields two incompatible structures.

Fla: -noassert
Effect: Do not compile assertion checks. Note that the special form assert false is always compiled because it is typed specially.

Fla: -nolabels
Effect: Ignore non-optional labels in types. Labels cannot be used in applications, and parameter order becomes strict.

Fla: -noprompt
Effect: Do not display any prompt when waiting for input.

Fla: -nopromptcont
Effect: Do not display the secondary prompt when waiting for continuation lines in multi-line inputs. This should be used e.g. when running ocaml in an emacs window.

Fla: -nostdlib
Effect: Do not include the standard library directory in the list of directories searched for source and compiled files.

Fla: -ppx command
Effect: After parsing, pipe the abstract syntax tree through the preprocessor command. The module Ast_mapper, described in chapter 27: Ast_mapper , implements the external interface of a preprocessor.

Fla: -principal
Effect: Check information path during type-checking, to make sure that all types are derived in a principal way. When using labelled arguments and/or polymorphic methods, this flag is required to ensure future versions of the compiler will be able to infer types correctly, even if internal algorithms change. All programs accepted in -principal mode are also accepted in the default mode with equivalent types, but different binary signatures, and this may slow down type checking; yet it is a good idea to use it once before publishing source code.

Fla: -rectypes
Effect: Allow arbitrary recursive types during type-checking. By default, only recursive types where the recursion goes through an object type are supported.

Fla: -safe-string
Effect: Enforce the separation between types string and bytes, thereby making strings read-only. This will become the default in a future version of OCaml.

Fla: -short-paths
Effect: When a type is visible under several module-paths, use the shortest one when printing the type’s name in inferred interfaces and error and warning messages. Identifier names starting with an underscore _ or containing double underscores __ incur a penalty of +10 when computing their length.

Fla: -stdin
Effect: Read the standard input as a script file rather than starting an interactive session.

Fla: -strict-sequence
Effect: Force the left-hand part of each sequence to have type unit.

Fla: -strict-formats
Effect: Reject invalid formats that were accepted in legacy format implementations. You should use this flag to detect and fix such invalid formats, as they will be rejected by future OCaml versions.

Fla: -unsafe
Effect: Turn bound checking off for array and string accesses (the v.(i) and s.[i] constructs). Programs compiled with -unsafe are therefore faster, but unsafe: anything can happen if the program accesses an array or string outside of its bounds.

Fla: -unsafe-string
Effect: Identify the types string and bytes, thereby making strings writable. For reasons of backward compatibility, this is the default setting for the moment, but this will change in a future version of OCaml.

Fla: -v
Effect: Print the version number of the compiler and the location of the standard library directory, then exit.

Fla: -verbose
Effect: Print all external commands before they are executed, Useful to debug C library problems.

Fla: -version
Effect: Print version string and exit.

Fla: -vnum
Effect: Print short version number and exit.

Fla: -no-version
Effect: Do not print the version banner at startup.

Page: https://caml.inria.fr/pub/docs/manual-ocaml/toplevel.html
Effect: Enable, disable, or mark as fatal the warnings specified by the argument warning-list. Each warning can be enabled or disabled, and each warning can be fatal or non-fatal. If a warning is disabled, it isn’t displayed and doesn’t affect compilation in any way (even if it is fatal). If a warning is enabled, it is displayed normally by the compiler whenever the source code triggers it. If it is enabled and fatal, the compiler will also stop with an error after displaying it.\nThe warning-list argument is a sequence of warning specifiers, with no separators between them.
Language: ocaml
Chapter: 10
Abbreviation: -w warning-list

Fla: -warn-error warning-list
Effect: Mark as fatal the warnings specified in the argument warning-list. The compiler will stop with an error when one of these warnings is emitted. The warning-list has the same meaning as for the -w option: a + sign (or an uppercase letter) marks the corresponding warnings as fatal, a - sign (or a lowercase letter) turns them back into non-fatal warnings, and a @ sign both enables and marks as fatal the corresponding warnings. Note: it is not recommended to use warning sets (i.e. letters) as arguments to -warn-error in production code, because this can break your build when future versions of OCaml add some new warnings.

Fla: -warn-help
Effect: Show the description of all available warning numbers.

Fla: - file
Effect: Use file as a script file name, even when it starts with a hyphen (-).