sheen

Types

pub type Command(a) =
  cb.Command(a)
pub type ParseResult(a) =
  Result(a, List(ParseError))
pub type Parser(a) {
  Parser(
    spec: ParserSpec,
    encoders: endec.Encoders,
    decoder: endec.Decoder(a),
  )
}

Constructors

  • Parser(
      spec: ParserSpec,
      encoders: endec.Encoders,
      decoder: endec.Decoder(a),
    )
pub type ParserSpec {
  ParserSpec(
    cmd: cb.CommandSpec,
    name: option.Option(String),
    authors: List(String),
    version: option.Option(String),
  )
}

Constructors

  • ParserSpec(
      cmd: cb.CommandSpec,
      name: option.Option(String),
      authors: List(String),
      version: option.Option(String),
    )

Functions

pub fn authors(
  to parser: ParserSpec,
  set authors: List(String),
) -> ParserSpec
pub fn build(
  from parser: ParserSpec,
  with command: fn(Builder(Nil)) -> Result(Builder(a), String),
) -> Result(Parser(a), String)
pub fn describe(
  description: String,
  cont: fn() -> fn(Builder(Nil)) -> Result(Builder(a), String),
) -> fn(Builder(Nil)) -> Result(Builder(a), String)
pub fn name(
  to parser: ParserSpec,
  set name: String,
) -> ParserSpec
pub fn new() -> ParserSpec
pub fn return(
  decoder: Decoder(a),
) -> fn(Builder(Nil)) -> Result(Builder(a), String)
pub fn run(
  parser: Parser(a),
  args: List(String),
) -> Result(a, List(ParseError))
pub fn usage(spec: ParserSpec) -> Document
pub fn valid(value: a) -> Decoder(a)
pub fn version(
  to parser: ParserSpec,
  set version: String,
) -> ParserSpec
Search Document