package feather

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

Module FeatherSource

Sourcetype cmd

process constructs a new command

Sourceval (|.) : cmd -> cmd -> cmd

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

Sourceval find : ?include_starting_dir:Base.bool -> ?ignore_hidden:Base.bool -> ?kind:[ `Files | `Directories ] -> ?name:Base.string -> ?depth:Base.int -> Base.string -> cmd

find lists files and/or directories, optionally filtering by name.

?depth: The maximum search depth, defaults to infinity.

?include_starting_dir: whether to include the starting directory passed into find. Defaults to false, notably different than the unix find utility.

Sourceval rg : ?in_:Base.string -> Base.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_:Base.string -> Base.string -> cmd
Sourceval grep : ?in_:Base.string -> Base.string -> cmd
Sourceval cat : Base.string -> cmd
Sourceval less : cmd
Sourceval mkdir : Base.string -> cmd
Sourceval mkdir_p : Base.string -> cmd
Sourceval sort : cmd
Sourceval uniq : cmd
Sourceval shuf : cmd
Sourceval head : ?file:Base.string -> Base.int -> cmd
Sourceval tail : ?file:Base.string -> Base.int -> cmd
Sourceval tail_f : Base.string -> cmd
Sourceval echo : Base.string -> cmd
Sourceval cut' : ?complement:Base.unit -> ?d:Base.char -> Base.int Base.list -> cmd
Sourceval cut : ?d:Base.char -> Base.int -> cmd
Sourceval pwd : cmd
Sourceval tr_d : Base.string -> cmd
Sourceval and_ : cmd -> cmd -> cmd

and_ is feather's version of a "&&" in bash. See Infix module for more.

Sourceval or_ : cmd -> cmd -> cmd

or_ is feather's version of a "||" in bash. See Infix module for more.

Sourceval sequence : cmd -> cmd -> cmd

sequence is feather's version of a ";" in bash. See Infix module for more.

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

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

Sourceval run_bg : ?cwd:Base.string -> ?env:(Base.string * Base.string) Base.list -> cmd -> Base.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 : Base.string -> cmd -> cmd
Sourceval append_stdout_to : Base.string -> cmd -> cmd
Sourceval write_stderr_to : Base.string -> cmd -> cmd
Sourceval append_stderr_to : Base.string -> cmd -> cmd
Sourceval read_stdin_from : Base.string -> cmd -> cmd
Sourcemodule 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 last_exit : Base.unit -> Base.int

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

Sourceval devnull : Base.string

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

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.