Add optional callbacks to the command behaviour
This commit is contained in:
parent
aaabab1fe9
commit
603dfd4cf0
|
|
@ -25,5 +25,13 @@ defmodule RabbitMQ.CLI.CommandBehaviour do
|
|||
@callback aliases() :: Keyword.t
|
||||
# Coerces run/2 return value into the standard command output form
|
||||
# that is then formatted, printed and returned as an exit code.
|
||||
@callback output(any, Map.t) :: :ok | {:ok, any} | {:stream, Enum.t} | {:error, ExitCodes.exit_code, [String.t]}
|
||||
# There is a default implementation for this callback in DefaultOutput module
|
||||
@callback output(any, Map.t) :: :ok | {:ok, any} | {:stream, Enum.t} |
|
||||
{:error, ExitCodes.exit_code, [String.t]}
|
||||
@optional_callbacks formatter: 0,
|
||||
scopes: 0,
|
||||
usage_additional: 0
|
||||
@callback formatter() :: Atom.t
|
||||
@callback scopes() :: [Atom.t]
|
||||
@callback usage_additional() :: String.t | [String.t]
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue