Documentation
¶
Overview ¶
Package editor provides editor configuration resolution for CLI commands.
This package handles resolving the appropriate text editor for various CLI operations (cipher edit, workload edit, cluster connect) with proper precedence: flags > config > environment variables > fallback editors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver handles editor configuration resolution with proper precedence.
func NewResolver ¶
NewResolver creates a new editor resolver.
func (*Resolver) Resolve ¶
Resolve resolves the editor command based on precedence: 1. --editor flag 2. spec.editor from config 3. Environment variables (SOPS_EDITOR, KUBE_EDITOR, EDITOR, VISUAL) 4. Fallback to vim, nano, vi.
func (*Resolver) SetEnvVars ¶
SetEnvVars sets the appropriate environment variables for the resolved editor. It returns a cleanup function that restores the original environment.