module Parameter = struct type t = | String of string | Number of string | Special of string | Null (** Possible shell parameters *) end module type State = sig type t (** State for the shell and operating system that is carried from one evaluation step to the next. *) val cwd : t -> Fpath.t (** The current working directory *) val set_cwd : t -> Fpath.t -> t (** Update the cwd *) val expand : t -> [ `Tilde ] -> string (** Expansions *) val lookup : t -> param:string -> Ast.word_cst option (** Parameter lookup. [None] means [unset]. *) val update : t -> param:string -> Ast.word_cst -> t (** Update the state with a new parameter mapping *) val dump : t Fmt.t end type redirect = | Redirect of int * Eio_unix.Fd.t * Eio_unix.Private.Fork_action.blocking | Close of Eio_unix.Fd.t module type Exec = sig type t (** An executor for commands *) type fork_action (** A fork action is a piece of C-code to run inbetween the fork and the exec *) val exec : ?fork_actions:fork_action list -> ?fds:redirect list -> ?stdin:_ Eio.Flow.source -> ?stdout:_ Eio.Flow.sink -> ?stderr:_ Eio.Flow.sink -> ?env:(string * string) list -> cwd:Eio.Fs.dir_ty Eio.Path.t -> t -> string list -> unit Exit.t (** Run a command in a child process *) end