WardrikDaemon. CLI. Command
(wardrik_daemon v0.1.0-rc.1)
Copy Markdown
One command wardrik takes, defined once for its help, its options and running it.
%WardrikDaemon.CLI.Command{
name: "agent ls",
shortcut: "ls",
group: "Agents",
arguments: "[QUERY]",
switches: [all: :boolean],
count: {0, :any},
summary: "list the agents, and what each is doing",
run: &ls/3
}Fields
:name- required. The words that name it, asagent ls.:group- required. The group help lists it under.:summary- required. One line on what it does.:arguments- how its arguments are typed in help, asAGENT MESSAGE.:details- more lines for its own help.:switches- the options it takes, asOptionParsertakes them.:count- how many arguments it takes: a number, or{least, :any}.0unless set.:shortcut- a shorter name it also takes, asls.:run- takes the arguments, the switches and theWardrikDaemon.CLI.Context.nilfor a commandbin/wardrikruns itself.
Summary
Functions
Returns whether command takes count arguments.
Returns how command is typed, as agent show AGENT [--json].
Returns the words that name command.
Types
@type run() :: ([String.t()], map(), WardrikDaemon.CLI.Context.t() -> :ok | {:error, String.t()})
@type t() :: %WardrikDaemon.CLI.Command{ arguments: String.t(), count: non_neg_integer() | {non_neg_integer(), :any}, details: [String.t()], group: String.t(), name: String.t(), run: run() | nil, shortcut: String.t() | nil, summary: String.t(), switches: keyword() }
Functions
@spec takes?(t(), non_neg_integer()) :: boolean()
Returns whether command takes count arguments.
Returns how command is typed, as agent show AGENT [--json].
Returns the words that name command.