Module Cmdliner

Declarative definition of command line interfaces.

Cmdliner provides a simple and compositional mechanism to convert command line arguments to OCaml values and pass them to your functions. The module automatically handles syntax errors, help messages and UNIX man page generation. It supports programs with single or multiple commands (like darcs or git) and respect most of the POSIX and GNU conventions.

Consult the basics, details about the supported command line syntax and examples of use. Open the module to use it, it defines only three modules in your scope.

v1.0.4 — homepage

Interface

module Manpage : sig ... end

Man page specification.

module Term : sig ... end

Terms.

module Arg : sig ... end

Terms for command line arguments.

Basics

Multiple terms

Documentation markup language

Manual

Miscellaneous

Command line syntax

Optional arguments

Positional arguments

Environment variables

Examples

A rm command

A cp command

A tail command

A darcs command