package batteries
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
Dune Dependency
Authors
Maintainers
Sources
md5=d02c4f044e53edca010de46f9139ce00
sha512=99a5afa3604c4cf0c849c670111d617f7f255acb0da043b73ddffdf0e299948bce52516ee31921f269de6088156c4e0a187e0b931543c6819c6b25966b303281
doc/batteries.unthreaded/BatOptParse/Formatter/index.html
Module BatOptParse.Formatter
Source
This module contains the types and functions for implementing custom usage message formatters.
type t = {
indent : unit -> unit;
(*Increase the indentation level.
*)dedent : unit -> unit;
(*Decrease the indentation level.
*)format_usage : string -> string;
(*Format usage string into style of this formatter.
*)format_heading : string -> string;
(*Format heading into style of this formatter.
*)format_description : string -> string;
(*Format description into style of this formatter.
*)format_option : (char list * string list) -> string list -> string option -> string;
(*Format option into style of this formatter (see explanation below).
*)
}
This is the type of a formatter. The format_option
has signature format_option (snames,lnames) metavars help
, where snames
is a list of the short option names, lnames
is a list of the long option names, metavars
is a list of the metavars the option takes as arguments, and help
is the help string supplied by the user.
Standard formatters
val indented_formatter :
?level:int ref ->
?indent:int ref ->
?indent_increment:int ->
?max_help_position:int ->
?width:int ->
?short_first:bool ->
unit ->
t
Create an "indented" formatter with the given options.
val titled_formatter :
?level:int ref ->
?indent:int ref ->
?indent_increment:int ->
?max_help_position:int ->
?width:int ->
?short_first:bool ->
unit ->
t
Creates a titled formatter which is quite similar to the indented formatter. See OptParse.Formatter.indented_formatter
for a description of the options.
Low-level formatting
wrap text width
reflows the given text paragraph into lines of width at most width
(lines may exceed this if the are single words that exceed this limit).
See OptParse.Formatter.wrap
.