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 ExecuteContext ¶ added in v1.0.35
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
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.
func WireCredentialRefSelection ¶ added in v1.1.67
WireCredentialRefSelection records the user-supplied --ref flag for the next keychain.Open* call and validates its <service>/<profile> shape up front so a bad value fails with a clear "--ref" error before any keyring work. The resolved precedence (--ref flag > <SERVICE>_CREDENTIAL_REF env > config credential_ref) is applied at keychain.open; this hook only records the flag.
Like WireBackendSelection, it is exported because cobra does NOT chain PersistentPreRunE — a subcommand that defines its own must call this explicitly. Reads via cmd.Flag() so persistent-flag inheritance works from any subcommand path.
Types ¶
This section is empty.