root

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 NewCmd

func NewCmd(f *cmdutil.Factory) *cobra.Command

NewCmd builds the root command with its global flags and core commands.

func Run

func Run(ctx context.Context, f *cmdutil.Factory, args []string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL