OCP-INDEX(1)

NAME

ocp-index - Explore the interfaces of installed OCaml libraries.

SYNOPSIS

ocp-index [COMMAND] …

DESCRIPTION

ocp-index is a simple and light-weight documentation extractor for OCaml, for command-line or integrated use (e.g. for completion). It gathers information from .cmi (like ocamlbrowser) and .cmt/cmti files, including structure, location, type, and ocamldoc comments when available.

COMMANDS

complete [OPTION]… STRING
    Output completions for a given prefix.

locate [OPTION]… STRING
    Get the location where an identifier was defined.

print [OPTION]… STRING [FORMAT]
    Print information about an identifier with a custom format.

type [OPTION]… STRING
    Print the type of an identifier.

OPTIONS

--build=DIR
    Set the current project build dir (default: try to guess)

-c WHEN, --color=WHEN
    Colorize the output. WHEN is either `always', `never' or `auto'.

--context=FILEPOS
    Will analyse the context at given FILE[:LINE[,COL]] to give appropriate answers w.r.t open modules, etc. To read from stdin, specify just `:', or alternatively `FILENAME:-' to still specify a filename which will be used to detect e.g. the owning library scope.

-F MODULES, --full-open=MODULES
    Like `--open', but if the .cmt is available, load even the elements that would be restricted by the interface. Useful for the current file.

-h LIST, --hide=LIST
    kinds of elements not to show in answers: LIST is a comma-separated list of element kinds (see `--show')

-I DIRS
    OCaml directories to (recursively) load the libraries from.

--no-build
    Don't include the build directory of the current project in lookups.

--no-opamlib
    Don't include the OPAM library directory (`opam var lib`) in lookups.

--no-stdlib
    Don't include the OCaml standard library directory (`ocamlc -where`) in lookups.

-O MODULES, --open=MODULES
    Consider the given (comma-separated list of) modules are opened for lookup.

--root=DIR
    Set the current project root (default: try to guess)

-s LIST, --show=LIST
    Kinds of elements to show in answers: LIST is a comma-separated list of `types', `values' and methods, `exceptions', `constructs' (record fields and sum type constructors), `modules' and classes, `sigs' (module and class types), `keywords'. The default is v,e,c,m,k

COMMON OPTIONS

--help[=FMT] (default=auto)
    Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.

--version
    Show version information.

EXIT STATUS

ocp-index exits with:

0   on success.

123 on indiscriminate errors reported on standard error.

124 on command line parsing errors.

125 on unexpected internal errors (bugs).