Documentation
¶
Overview ¶
Package editor provides editor configuration resolution with proper precedence.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupEditorEnv ¶ added in v5.30.0
func SetupEditorEnv(editorFlag, forCommand string) func()
SetupEditorEnv sets up the editor environment variables based on flag and config. It returns a cleanup function that should be called to restore the original environment.
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.