Documentation
¶
Overview ¶
Package doctor registers project diagnostics without the normal executable configuration bootstrap.
Index ¶
- Constants
- func FailBeforeDispatch(args []string, err error) error
- func InvocationIndex(args []string, rootFlags *pflag.FlagSet) (int, bool)
- func IsConfigFree(cmd *cobra.Command) bool
- func IsInvocation(args []string, rootFlags *pflag.FlagSet) bool
- func NewCommand() *cobra.Command
- type CommandProvider
- func (*CommandProvider) GetAliases() []internal.CommandAlias
- func (*CommandProvider) GetCommand() *cobra.Command
- func (*CommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag
- func (*CommandProvider) GetFlagsBuilder() flags.Builder
- func (*CommandProvider) GetGroup() string
- func (*CommandProvider) GetName() string
- func (*CommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder
- func (*CommandProvider) IsExperimental() bool
Constants ¶
const ConfigFreeAnnotation = "atmos.tools/config-free"
ConfigFreeAnnotation marks a command that never loads atmos.yaml. Anything that would read the configuration on its behalf, such as the telemetry disclosure or the update check shown with help, must skip it so a malformed configuration cannot surface through those paths.
Variables ¶
This section is empty.
Functions ¶
func FailBeforeDispatch ¶
FailBeforeDispatch reports a failure that happens before doctor's command runs (for example an unusable --chdir) for the raw command-line args. Machine formats receive the usual operational_error report on stdout and exit with the usage status; other formats return err unchanged.
func InvocationIndex ¶
InvocationIndex reports whether args invoke the doctor command and, when they do, the index of the "doctor" token. Callers use the index to treat the leading root flags and the command's own arguments separately, because an optional-value root flag such as --pager must never absorb the command name.
func IsConfigFree ¶
IsConfigFree reports whether cmd, or one of its parents, runs without loading atmos.yaml.
func IsInvocation ¶
IsInvocation reports whether args (the arguments after the program name) invoke the doctor command once leading root-level flags are skipped.
Flag arity is derived from the root command's persistent flags rather than a hand-maintained allowlist, so a newly added root flag cannot silently route `atmos <flag> doctor` through normal configuration loading, which would crash on exactly the malformed configuration that doctor exists to diagnose. Unknown leading flags are treated as value-less: doctor then reaches Cobra, which reports the unknown flag, instead of the configuration loader.
func NewCommand ¶
NewCommand constructs an isolated command for registration and tests.
Types ¶
type CommandProvider ¶
type CommandProvider struct{}
CommandProvider supplies the built-in doctor command.
func (*CommandProvider) GetAliases ¶
func (*CommandProvider) GetAliases() []internal.CommandAlias
func (*CommandProvider) GetCommand ¶
func (*CommandProvider) GetCommand() *cobra.Command
func (*CommandProvider) GetCompatibilityFlags ¶
func (*CommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag
func (*CommandProvider) GetFlagsBuilder ¶
func (*CommandProvider) GetFlagsBuilder() flags.Builder
func (*CommandProvider) GetGroup ¶
func (*CommandProvider) GetGroup() string
func (*CommandProvider) GetName ¶
func (*CommandProvider) GetName() string
func (*CommandProvider) GetPositionalArgsBuilder ¶
func (*CommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder
func (*CommandProvider) IsExperimental ¶
func (*CommandProvider) IsExperimental() bool