Module B0_editor

Editor interaction.

Editing

type t

The type for editors.

val find : ?search:B0_std.Cmd.tool_search -> ?cmd:B0_std.Cmd.t -> unit -> (t, string) Stdlib.result

find ?search ?cmd () finds a suitable editor. This is (in order):

  • Ok e or Error _ if cmd is specified and according to whether OS.Cmd.get ?search succeeds
  • Ok e if pager is a tool invocation parsed from the VISUAL environment variable that can be found via Os.Cmd.find ?search.
  • Ok e if pager is a tool invocation parsed from the EDITOR environment variable that can be found via Os.Cmd.find ?search
  • Ok e if Cmd.tool "nano" can be found via Os.Cmd.find ?search.
  • Error _ otherwise.
val edit_files : t -> B0_std.Fpath.t list -> (B0_std.Os.Cmd.status, string) Stdlib.result

edit_files editor fs uses editor to edit the files fs. If editor is:

  • None, an error message is returned mentioning that no editor was found.
  • Some editor invokes the command with files fs and returns the exit status of the program.

Cli interaction

module Env : sig ... end

Environment variables.