ex_cli v0.1.1 ExCLI

Module containing functions to interact with modules using ExCLI.DSL

Summary

Functions

Parse the arguments with a module using ExCLI.DSL

Parse and run the arguments with a module using ExCLI.DSL

Displays the usage for the given module

Functions

parse(module, args \\ System.argv())

Specs

parse(atom, [String.t]) ::
  {:ok, atom, map} |
  {:error, atom, Keyword.t}

Parse the arguments with a module using ExCLI.DSL

Example

case ExCLI.parse(MyApp.CLI) do
  {:ok, command, context} ->
    do_something(command, context)
  {:error, reason, details} ->
    handle_error(reason, details)
end
run(module, args \\ System.argv())

Specs

run(atom, [String.t]) ::
  any |
  {:error, atom, Keyword.t}

Parse and run the arguments with a module using ExCLI.DSL

Example

  ExCLI.run(MyApp.CLI)

  ExCLI.run(MyApp.CLI, ["some", "args"])
run!(module, args \\ System.argv(), opts \\ [])

Specs

run!(atom, [String.t], Keyword.t) :: any
usage(module, opts \\ [])

Displays the usage for the given module