Documentation
¶
Overview ¶
Package root builds the `lfed` root command and dispatches unknown commands to plugins. See Run for the dispatch mechanism.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run executes argv for the lfed CLI.
It pre-scans args before Cobra sees them. CLI flags before the first word are recognised by the root persistent flag set; the first word that is not a flag is the command. A core command, "help" of a core command, "completion" or the Cobra completion hooks go to Cobra unchanged. Any other word is a plugin name: the remaining args are forwarded raw, after CLI flags in them (-c, -o, --jq, --yes, --insecure-storage) are also applied to the lfed CLI. Cobra would otherwise strip or reject flags it does not own, so the plugin would not see its own flags.
Stdout is wrapped in an OutputCapture so --jq can filter the JSON the command or plugin printed once it has finished.
Types ¶
This section is empty.