outil/help

Types

A function using the command line arguments which can return command error reasons.

pub type UseArgs(a) =
  fn(List(String)) -> Result(a, Reason)

Functions

pub fn wrap_usage(
  cmd: Command,
  continue: fn(List(String)) -> Result(a, Reason),
) -> Result(a, CommandReturn(b))

Given a command, if the command line arguments contain --help or -h then return a help “error” with the usage string. Otherwise, pass the arguments to the given function and if it returns an error, wrap it in a CommandLineError with the usage string.

Search Document