ex_cli v0.1.2 ExCLI View Source

Module containing functions to interact with modules using ExCLI.DSL

Link to this section 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

Link to this section Functions

Link to this function parse(module, args \\ System.argv()) View Source
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
Link to this function run(module, args \\ System.argv()) View Source
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"])
Link to this function run!(module, args \\ System.argv(), opts \\ []) View Source
run!(atom, [String.t], Keyword.t) :: any
Link to this function usage(module, opts \\ []) View Source

Displays the usage for the given module