spin

OCaml project generator
Library spin.inquire
Module Inquire . Style
type color =
| Black
| Red
| Green
| Yellow
| Blue
| Magenta
| Cyan
| White
| Bright_black
| Bright_red
| Bright_green
| Bright_yellow
| Bright_blue
| Bright_magenta
| Bright_cyan
| Bright_white
| Default

Available colors.

type style =
| Reset
| Bold
| Underlined
| Inverse
| Hidden
| Foreground of color
| Background of color

Various styles for the text. Blink and Hidden may not work on every terminal.

val black : style

Shortcut for Foreground Black

val red : style

Shortcut for Foreground Red

val green : style

Shortcut for Foreground Green

val yellow : style

Shortcut for Foreground Yellow

val blue : style

Shortcut for Foreground Blue

val magenta : style

Shortcut for Foreground Magenta

val cyan : style

Shortcut for Foreground Cyan

val white : style

Shortcut for Foreground White

val bg_black : style

Shortcut for Background Black

val bg_red : style

Shortcut for Background Red

val bg_green : style

Shortcut for Background Green

val bg_yellow : style

Shortcut for Background Yellow

val bg_blue : style

Shortcut for Background Blue

val bg_magenta : style

Shortcut for Background Magenta

val bg_cyan : style

Shortcut for Background Cyan

val bg_white : style

Shortcut for Background White

val bg_default : style

Shortcut for Background Default

val bold : style

Shortcut for Bold

val underlined : style

Shortcut for Underlined

Shortcut for Blink

val inverse : style

Shortcut for Inverse

val hidden : style

Shortcut for Hidden

type t
val default : t

The default style used by Inquire prompts if none is provided.

val make : ?qmark_icon:string -> ?qmark_format:Ansi.style list -> ?message_format:Ansi.style list -> ?error_icon:string -> ?error_format:Ansi.style list -> ?default_format:Ansi.style list -> ?option_icon_marked:string -> ?option_icon_unmarked:string -> ?pointer_icon:string -> unit -> t

Create a custom style.

  • qmark_icon is the icon used for the question mark that prefixes the prompt.
  • qmark_format is the format of the question mark.
  • message_format is the format of the prompt message.
  • error_icon is the icon used for error messages.
  • error_format is the format used for the error messages.
  • default_format is the format used for the default tooltip of the prompt, if present.
  • option_icon_marked is the icon used to mark selected options in multi-selection prompts.
  • option_icon_unmarked is the icon used to mark unselected options in multi-selection prompts.
  • pointer_icon is the icon used to mark the selected option in single-selection prompts.