editor

package
v6.16.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func SetupEditorEnv(cmd *cobra.Command, editorFlag, forCommand string) func()

SetupEditorEnv sets up the editor environment variables based on flag and config. When cmd is non-nil, the --config persistent flag is honored for config loading. 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

func NewResolver(flagEditor string, cfg *v1alpha1.Cluster) *Resolver

NewResolver creates a new editor resolver.

func (*Resolver) Resolve

func (r *Resolver) Resolve() string

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

func (r *Resolver) SetEnvVars(editorCmd string, forCommand string) func()

SetEnvVars sets the appropriate environment variables for the resolved editor. It returns a cleanup function that restores the original environment.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL