JustBash.CLI.Invocation (JustBash v0.4.0)
View SourceThe single argument passed to a JustBash.CLI command handler.
A handler is a one-argument function that receives an %Invocation{} and returns
{result, bash} — exactly the contract of JustBash.Commands.Command.execute/3.
def review(%JustBash.CLI.Invocation{flags: flags, bash: bash}) do
report = MyApp.PullRequests.fetch!(flags.report, bash.context.user)
{JustBash.Commands.Command.ok(render(report, flags.format)), bash}
endFields
:bash— the fullJustBash.t/0struct (fs, env, context, …):flags— a map of parsed flag values, keyed by the flag's atom name:args— the remaining positional arguments, as a list of strings:extra_flags— undeclared flag tokens collected when the leaf setsallow_unknown_flags: true, as a raw list of strings (empty otherwise); ready to forward verbatim to a backend:stdin— the command's stdin, as a string:path— the resolved subcommand path that routed here, e.g.["pr", "review"]