root

package
v1.0.55 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package root provides the top-level gro command and global flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute runs the root command with a background context

func ExecuteContext added in v1.0.35

func ExecuteContext(ctx context.Context)

ExecuteContext runs the root command with the given context. os.Exit stays strictly AFTER runRoot returns so runRoot's deferred FlushMigrationNotice is never skipped by the exit (it would be if the defer lived here).

func WireBackendSelection added in v1.0.53

func WireBackendSelection(cmd *cobra.Command) error

WireBackendSelection validates the user-supplied --backend flag and records it for the next keychain.Open* call. Cobra-layer only — it does NOT load config; openWith binds the flag pair against cfg.Keyring.Backend at the single credstore.Open call site.

Exported so a subcommand that defines its own PersistentPreRunE can call it explicitly: cobra does NOT chain PersistentPreRunE, so a shadowing subcommand silently loses the wiring without this hook. gro has no shadowers today; the regression test guards the pattern.

Reads via cmd.Flag() so persistent-flag inheritance works from any subcommand path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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