Module Core_extended.Readline

Interactive line editing.

This implements very basic readline abilities: backspace, left and right arrows work as expected. There's also a history that can be browsed through the up and down arrows.

type completer = left:string ‑> right:string ‑> string list
module History : sig ... end

A mutable variable representing the history.

val input_line : ?⁠history:History.t ‑> ?⁠prompt:string ‑> ?⁠text:string ‑> ?⁠tab_completion:completer ‑> unit ‑> string option
val input_line_eof : ?⁠history:History.t ‑> ?⁠prompt:string ‑> ?⁠text:string ‑> ?⁠tab_completion:completer ‑> unit ‑> string
val password : ?⁠prompt:string ‑> unit ‑> string option

Prompts for a password. Displays '*' instead of typed characters.

val confirm : ?⁠prompt:string ‑> string ‑> bool

Prompts for an answer. Returns true if the answer equals the given string (ignoring case), false otherwise.

val choice : (string * 'a) list ‑> 'a option

choice ["a",a;"b",b] Prompts the user to choose a between several value (associated to strings) and returns the value chosen by the user.