wand v0.3.1 Wand.CLI.Command behaviour View Source

The interface for each type of command that wand supports. To add a new command, the following things must take place:

  1. Add the name of the module to routes below
  2. Create a module inside the lib/cli/commands folder that implements Wand.CLI.Command
  3. Update Wand.CLI.ArgParser if you need to add a shorthand version
  4. Update the help file in Wand with the appropriate text

Link to this section Summary

Link to this section Types

Link to this type ok_or_exit() View Source
ok_or_exit() :: :ok | {:error, integer()}

Link to this section Functions

Link to this section Callbacks

Link to this callback after_save(data) View Source
after_save(data :: any()) :: ok_or_exit()
Link to this callback execute(data, extras) View Source
execute(data :: any(), extras :: map()) :: ok_or_exit()
Link to this callback handle_error(type, data) View Source
handle_error(type :: atom(), data :: any()) :: String.t()
Link to this callback help(type) View Source
help(type :: any()) :: any()
Link to this callback validate(args) View Source
validate(args :: list()) :: {:ok, any()} | {:error, any()}