Vexil (Vexil v0.1.0) View Source

Documentation for Vexil.

Link to this section Summary

Link to this section Types

Specs

argv() :: Vexil.Utils.argv()

Specs

find_flags_error() ::
  {:error, :unknown_flag, String.t()} | {:error, :duplicate_flag, atom()}

Specs

find_flags_result() ::
  {:ok, parsed_flags(), [find_flags_error()], argv()} | find_flags_error()

Specs

find_options_error() ::
  {:error, :unknown_option, String.t()}
  | {:error, :duplicate_option, atom()}
  | {:error, :invalid_value, atom(), String.t()}
  | {:error, :missing_required_options, [atom()]}

Specs

find_options_result() ::
  {:ok, parsed_options(), [find_options_error()], argv()} | find_options_error()

Specs

flags() :: [{atom(), Vexil.Structs.Flags.t()}]

Specs

found() :: [{:ok | :error, atom(), any()}]

Specs

options() :: [{atom(), Vexil.Structs.Options.t()}]

Specs

Specs

parse_spec() :: [parse_spec_item()]

Specs

parse_spec_item() ::
  {:flags, flags()}
  | {:options, options()}
  | {:obey_double_dash, boolean()}
  | {:error_early, boolean()}

Specs

parsed_flags() :: %{required(atom()) => pos_integer() | boolean()}

Specs

parsed_items() :: %{
  flags: parsed_flags(),
  options: parsed_options(),
  argv: argv()
}

Specs

parsed_options() :: %{required(atom()) => any()}

Specs

validate_argv_error() :: {:error, :invalid_argv}

Specs

validate_opts_error() ::
  {:error,
   :invalid_flag
   | :invalid_option
   | :required_option_has_default
   | :invalid_parser, atom()}
  | {:error, :conflicting_key, String.t()}
  | {:error, :flags_not_keywords | :options_not_keywords}

Link to this section Functions

Specs

parse(argv(), parse_spec()) :: parse_result()
Link to this function

parse!(argv, opts \\ [])

View Source

Specs

parse!(argv(), parse_spec()) :: any()