Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindEnv ¶ added in v1.3.1
BindEnv wires the canonical DEVSY_* env var into a cobra flag. Call it immediately after the flag's *Var registration. If the env var is set, the value is applied to the flag (Changed=true, satisfying MarkFlagRequired) and the usage string advertises the env var.
Failure modes are loud by design:
- panics if the flag is not registered (programmer bug at startup);
- log.Fatalf if the env value is rejected by the flag's type (operator bug; e.g. DEVSY_DEBUG=garbage on a bool flag). This matches the contract of the prior inheritFlagsFromEnvironment loop so misconfigured env vars are never silently ignored.
Types ¶
type GlobalFlags ¶
type GlobalFlags struct {
Context string
Provider string
AgentDir string
DevsyHome string
UID string
Owner platform.OwnerFilter
LogOutput string
ResultFormat string
Verbosity int
Quiet bool
Debug bool
}
func SetGlobalFlags ¶
func SetGlobalFlags(flags *flag.FlagSet) *GlobalFlags
SetGlobalFlags applies the global flags.
Click to show internal directories.
Click to hide internal directories.