Credo.CLI.Command behaviour (Credo v1.5.0) View Source
Command
is used to describe commands which can be executed from the command line.
The default command is Credo.CLI.Command.Suggest.SuggestCommand
.
A basic command that writes "Hello World" can be implemented like this:
defmodule HelloWorldCommand do
use Credo.CLI.Command
def call(_exec, _opts) do
Credo.CLI.Output.UI.puts([:yellow, "Hello ", :orange, "World"])
end
end
Link to this section Summary
Callbacks
Runs the Command.
Link to this section Types
Specs
t() :: module()
Link to this section Callbacks
Specs
call(exec :: Credo.Execution.t(), opts :: list()) :: Credo.Execution.t()
Runs the Command.