Credo v1.1.5 Credo.CLI.Command behaviour 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

Link to this section Callbacks

Link to this callback call(exec, opts) View Source
call(exec :: Credo.Execution.t(), opts :: List.t()) :: List.t()

Runs the Command.