module Interaction: sig
.. end
Keyboard interaction functions (build “menus”, ask questions, etc.)
val init : unit -> unit
Initialize the module.
val toggle_verbose : unit -> unit
Turn on or off messages about which key is pressed.
The type of a menu item.
: ?char:char -> ?log:SmartPrint.t -> 'a -> 'a menu_item
Represent a menu item.
: ?max_per_page:int ->
?always_there:'a menu_item list ->
sentence:SmartPrint.t ->
'a menu_item list ->
('a, [> `Failure of string ]) Unix_io.t
Display a menu given the specified menu_items
val open_in_dollar_editor : string -> (unit, 'a) Unix_io.Deferred_result.t
Open a file in "$EDITOR"
.
val view_in_dollar_editor : ?extension:string ->
string ->
(unit, [> `IO of [> `Write_file_exn of string * exn ] ])
Unix_io.Deferred_result.t
View a string in "$EDITOR"
.
val ask_for_edition : ?extension:string ->
string ->
(string,
[> `IO of
[> `Read_file_exn of Unix_io.IO.path * exn
| `Write_file_exn of Unix_io.IO.path * exn ] ])
Unix_io.Deferred_result.t
Edit content in "$EDITOR"
.
val get_key : unit -> (char, [> `Failure of string ]) Unix_io.t
Get a key from the terminal input.
val build_sublist_of_targets : client:Ketrew.Client.t ->
list_name:string ->
all_log:SmartPrint.t ->
go_verb:SmartPrint.t ->
filter:(Ketrew_pure.Target.t -> bool) ->
([> `Cancel | `Go of string list ],
[> `Client of Ketrew.Client.Error.t
| `Database of Trakeva.Error.t
| `Failure of string
| `IO of
[> `Read_file_exn of string * exn | `Write_file_exn of string * exn ]
| `Missing_data of string
| `System of [> `File_info of string ] * [> `Exn of exn ]
| `Target of [> `Deserilization of string ] ])
Unix_io.t
Figure out the targets to be displayed.
: targets:Ketrew_pure.Target.t list ->
?filter_target:(Ketrew_pure.Target.t -> bool) ->
unit -> [> `Go of string ] menu_item list
Create a menu with the targets.
val run_with_quit_key : < start : (unit, [> `Failure of string ] as 'start_error)
Unix_io.Deferred_result.t;
stop : unit > ->
(unit, 'start_error) Unix_io.Deferred_result.t
Start and run an action until it finishes or unitl the key
"q"
is pressed.