optimus v0.1.10 Optimus

Link to this section Summary

Link to this section Types

Link to this type

arg_spec_item()

arg_spec_item() :: {name :: atom(), [arg_spec_param()]}
Link to this type

arg_spec_param()

arg_spec_param() ::
  {:value_name, String.t()}
  | {:help, String.t()}
  | {:required, boolean()}
  | {:parser, parser()}
Link to this type

custom_parser()

custom_parser() :: (String.t() -> parser_result())
Link to this type

error()

error() :: String.t()
Link to this type

flag_spec_item()

flag_spec_item() :: {name :: atom(), [flag_spec_param()]}
Link to this type

flag_spec_param()

flag_spec_param() ::
  {:short, String.t()}
  | {:long, String.t()}
  | {:help, String.t()}
  | {:multiple, boolean()}
Link to this type

option_spec_item()

option_spec_item() :: {name :: atom(), [option_spec_param()]}
Link to this type

option_spec_param()

option_spec_param() ::
  {:value_name, String.t()}
  | {:short, String.t()}
  | {:long, String.t()}
  | {:help, String.t()}
  | {:multiple, boolean()}
  | {:required, boolean()}
  | {:parser, parser()}
  | {:default, any()}
Link to this type

parser()

parser() :: :integer | :float | :string | custom_parser()
Link to this type

parser_result()

parser_result() :: {:error, String.t()} | {:ok, term()}
Link to this type

spec()

spec() :: [spec_item()]
Link to this type

spec_item()

spec_item() ::
  {:name, String.t()}
  | {:description, String.t()}
  | {:version, String.t()}
  | {:author, String.t()}
  | {:about, String.t()}
  | {:allow_unknown_args, boolean()}
  | {:parse_double_dash, boolean()}
  | {:args, [arg_spec_item()]}
  | {:flags, [flag_spec_item()]}
  | {:options, [option_spec_item()]}
Link to this type

subcommand_path()

subcommand_path() :: [atom()]
Link to this opaque

t()

(opaque)
t()

Link to this section Functions

Link to this function

fetch_subcommand(optimus, subcommand_path)

Link to this function

fetch_subcommand(optimus, list, subcommand_name)

Link to this function

from_yaml(filename)

from_yaml(filename :: String.t()) :: {:ok, t()} | {:error, error()}
Link to this function

from_yaml!(filename)

from_yaml!(filename :: String.t()) :: t() | no_return()
Link to this function

new(props)

new(spec()) :: {:ok, t()} | {:error, [error()]}
Link to this function

new!(props)

new!(spec()) :: t() | no_return()
Link to this function

parse(optimus, command_line)

parse(t(), [String.t()]) ::
  {:ok, Optimus.ParseResult.t()}
  | {:ok, subcommand_path(), Optimus.ParseResult.t()}
  | {:error, [error()]}
  | {:error, subcommand_path(), [error()]}
  | :version
  | :help
  | {:help, subcommand_path()}
Link to this function

parse!(optimus, command_line, halt \\ &System.halt/1)