This repository has no description
1module type S = sig
2 type config
3 (** A configuration *)
4
5 val config_term : config Cmdliner.Term.t
6 (** A cmdliner term for constructing a config *)
7
8 type action
9 (** An action to run *)
10
11 val action : action Repr.t
12 val action_of_command : string -> action
13
14 type entry
15
16 type ctx
17 (** A context that is not persisted, but is passed through each loop of the
18 shell *)
19
20 val init :
21 _ Eio.Path.t ->
22 Eio_unix.Process.mgr_ty Eio_unix.Process.mgr ->
23 entry History.t ->
24 ctx
25 (** [init store] will be called before entering the shell loop. You may wish
26 to setup history completions etc. with LNoise. *)
27
28 val run :
29 config ->
30 stdout:Eio.Flow.sink_ty Eio.Flow.sink ->
31 Eio.Fs.dir_ty Eio.Path.t ->
32 _ Eio.Time.clock ->
33 Eio_unix.Process.mgr_ty Eio_unix.Process.mgr ->
34 entry History.t * ctx ->
35 action ->
36 (entry History.t * ctx, Eio.Process.error) result
37 (** [run history action] runs the action in [history]. Return a new [history]
38 that can be persisted *)
39
40 val prompt : Eio.Process.exit_status -> entry History.t -> string
41 (** [prompt previous_exit_code history] generates a prompt from the current
42 [history] *)
43end