Module AFTN.Selection

User selections from stdin

type 'a selection =
  1. | Back
    (*

    User wants to go back

    *)
  2. | Invalid of string option
    (*

    User gave an invalid selection, optional error string

    *)
  3. | Selected of 'a
    (*

    User selected something

    *)
val reset_terminal : unit -> unit
val read_n_chars : int -> bytes
val get_int_selection : ?keys:char list -> ?back_string:string -> string -> string list -> bool -> int option

Given a prompt and a list of options, prompt the user to select an option by index or matching string via stdin

val confirm : string option -> bool

A yes-or-no confirmation with a customizable prompt