Runs a Juggernaut.CLI.Task: parses argv, prints --help, executes, reports errors
and returns the exit code (design notes §3).
Output goes through Mix.shell/0. An error is printed to stderr as error: message,
or, when the requested format is agent or json, as one JSON document on stdout:
{"format":1,"kind":"error","exit_code":2,"error":{"type":"usage","message":"..."}}
Summary
Functions
The agent/JSON error document (see the agent output guide), keys in a stable order.
The --format option for a task that offers choices. A JUGGERNAUT_FORMAT naming a
format this task does not offer is ignored, so one setting serves every task.
Runs task with argv and ends the Mix task with its exit code.
Prints error in format and returns its exit code.
Runs task with argv in ctx and returns the exit code.
Functions
@spec error_document(Juggernaut.Error.t(), Juggernaut.CLI.ExitCode.t()) :: Jason.OrderedObject.t()
The agent/JSON error document (see the agent output guide), keys in a stable order.
The --format option for a task that offers choices. A JUGGERNAUT_FORMAT naming a
format this task does not offer is ignored, so one setting serves every task.
Runs task with argv and ends the Mix task with its exit code.
@spec report(Juggernaut.Error.t(), atom()) :: Juggernaut.CLI.ExitCode.t()
Prints error in format and returns its exit code.
@spec run(module(), [String.t()], Juggernaut.CLI.Task.ctx()) :: Juggernaut.CLI.ExitCode.t()
Runs task with argv in ctx and returns the exit code.