package feather

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module FeatherSource

Sourcetype cmd
Sourceval process : string -> string list -> cmd

process constructs a new command

Sourceval cat : string -> cmd
Sourceval echo : string -> cmd
Sourceval ls : string -> cmd
Sourceval sh : string -> cmd
Sourceval rg : ?in_:string -> string -> cmd

in_ is the directory that should be rg'd: rg <search> <in>. Without it, it'll filter stdin, just rg <search>

Sourceval rg_v : ?in_:string -> string -> cmd
Sourceval find : ?include_starting_dir:bool -> ?ignore_hidden:bool -> ?kind:[ `Files | `Directories ] -> ?name:string -> ?depth:int -> string -> cmd
Sourceval tr : string -> string -> cmd
Sourceval tr_d : string -> cmd
Sourceval grep : ?in_:string -> string -> cmd
Sourceval mkdir : string -> cmd
Sourceval mkdir_p : string -> cmd
Sourceval pwd : cmd
Sourceval less : cmd
Sourceval sort : cmd
Sourceval uniq : cmd
Sourceval shuf : cmd
Sourceval head : ?file:string -> int -> cmd
Sourceval tail : ?file:string -> int -> cmd
Sourceval tail_f : string -> cmd
Sourceval cp : string -> string -> cmd
Sourceval cp_r : string -> string -> cmd
Sourceval mv : string -> string -> cmd
Sourceval sed : ?g:bool -> string -> string -> cmd
Sourceval cut : ?d:char -> int -> cmd
Sourceval cut' : ?complement:unit -> ?d:char -> int list -> cmd
Sourceval (|.) : cmd -> cmd -> cmd

|. is feather's version of a "|" in bash.

Sourceval collect_lines : ?cwd:string -> ?env:(string * string) list -> cmd -> string list
Sourceval collect_stdout : ?cwd:string -> ?env:(string * string) list -> cmd -> string
Sourceval map_lines : f:(string -> string) -> cmd
Sourceval filter_lines : f:(string -> bool) -> cmd

map within a series of pipes will be run in a thread.

Sourceval run : ?cwd:string -> ?env:(string * string) list -> cmd -> unit
Sourceval run_bg : ?cwd:string -> ?env:(string * string) list -> cmd -> unit

Run the process in a thread. Use wait to ensure that the parent won't exit, subsequently killing the background process.

Sourceval write_stdout_to : string -> cmd -> cmd
Sourceval append_stdout_to : string -> cmd -> cmd
Sourceval write_stderr_to : string -> cmd -> cmd
Sourceval append_stderr_to : string -> cmd -> cmd
Sourcemodule File_redirection_infix : sig ... end
Sourceval stdout_to_stderr : cmd -> cmd
Sourceval stderr_to_stdout : cmd -> cmd

stdout_to_stderr and stderr_to_stdout are NOT composable! Think of these functions as each creating a new command with the given redirection.

Applying both will result in no output to either stdout or stderr. flip_stdout_and_stderr should be easy to write if anyone should need it.

Sourceval devnull : string

devnull is easier to type than "/dev/null"

Sourceval last_exit : unit -> int

last_exit returns the exit status of the last child process to have exited

Sourceval fzf : ?cwd:string -> ?env:(string * string) list -> cmd -> string option

fzf runs the command, and fuzzy finds the stdout. Returns None if no item was chosen, Some str otherwise

Note that fzf is a way to to run a cmd and does not in itself return a cmd.

Sourceval debug : bool Core.ref