ex_cli v0.0.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

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"])