package spin

  1. Overview
  2. Docs
OCaml project generator

Install

Dune Dependency

Authors

Maintainers

Sources

opam-spin-0.8.2.tbz
sha256=4ca1b0cf7fccdbef2e2e8cba47a66333b2ec1535d45792f5d6ddb8d62824a9eb
sha512=fbb209d50f89f9d924626ba1d12b18f22acd7e3e457a5d371668d0bba3ef8e03fb3d0cac55f3e915f030ce77ecd1a48c471f7c83820f95b996b57cee6ff72e92

doc/src/spin.inquire/style.ml.html

Source file style.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
include Ansi

type t =
  { 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
  }

let default =
  { qmark_icon = "?"
  ; qmark_format = [ Ansi.green ]
  ; message_format = [ Ansi.bold ]
  ; error_icon = "X"
  ; error_format = [ Ansi.red; Ansi.bold ]
  ; default_format = []
  ; option_icon_marked = "○"
  ; option_icon_unmarked = "●"
  ; pointer_icon = "»"
  }

let make
    ?qmark_icon
    ?qmark_format
    ?message_format
    ?error_icon
    ?error_format
    ?default_format
    ?option_icon_marked
    ?option_icon_unmarked
    ?pointer_icon
    ()
  =
  let qmark_icon = Option.value qmark_icon ~default:default.qmark_icon in
  let qmark_format = Option.value qmark_format ~default:default.qmark_format in
  let message_format =
    Option.value message_format ~default:default.message_format
  in
  let error_icon = Option.value error_icon ~default:default.error_icon in
  let error_format = Option.value error_format ~default:default.error_format in
  let default_format =
    Option.value default_format ~default:default.default_format
  in
  let option_icon_marked =
    Option.value option_icon_marked ~default:default.option_icon_marked
  in
  let option_icon_unmarked =
    Option.value option_icon_unmarked ~default:default.option_icon_unmarked
  in
  let pointer_icon = Option.value pointer_icon ~default:default.pointer_icon in
  { qmark_icon
  ; qmark_format
  ; message_format
  ; error_icon
  ; error_format
  ; default_format
  ; option_icon_marked
  ; option_icon_unmarked
  ; pointer_icon
  }
OCaml

Innovation. Community. Security.