Documentation
¶
Index ¶
- Constants
- func ExecuteShellCompletion(ctx context.Context, cmd *cli.Command) error
- func FishPackagePickerScript() ([]byte, error)
- func IsPickerInstalled(ctx context.Context, options PickerInstallation) (bool, error)
- func OutputCompletionScript(ctx context.Context, cmd *cli.Command) error
- func WithPickerSetupLock(ctx context.Context, directory string, change func() error) error
- type CompletionResult
- type CompletionStyle
- type PickerInstallResult
- type PickerInstallation
- type ShellCompletion
- type ShellCompletionBehavior
Constants ¶
const ( ShellCompletionBehaviorDefault ShellCompletionBehavior = iota ShellCompletionBehaviorFile = 10 ShellCompletionBehaviorNoComplete = 11 )
Variables ¶
This section is empty.
Functions ¶
func ExecuteShellCompletion ¶
func FishPackagePickerScript ¶ added in v1.37.0
FishPackagePickerScript renders the Linux package's vendor_conf.d script. It checks consent at activation and the selected executable at every Tab press.
func IsPickerInstalled ¶ added in v1.36.0
func IsPickerInstalled(ctx context.Context, options PickerInstallation) (bool, error)
IsPickerInstalled verifies an intact profile block and an owned script that matches this CLI's current content, without creating files or locking.
func OutputCompletionScript ¶
func WithPickerSetupLock ¶ added in v1.36.0
WithPickerSetupLock serializes a command's complete setup decision, including all startup profiles and its opt-out preference. Its lock is distinct from the per-file transaction locks used by InstallPicker and RemovePicker.
Types ¶
type CompletionResult ¶
type CompletionResult struct {
Completions []ShellCompletion
Behavior ShellCompletionBehavior
// FileValuePrefix is emitted only for an assigned file value. Shells use it
// to distinguish --file=path from a separated path that contains an equals.
FileValuePrefix string
// contains filtered or unexported fields
}
func GetCompletions ¶
func GetCompletions(completionStyle CompletionStyle, root *cli.Command, args []string) CompletionResult
type CompletionStyle ¶
type CompletionStyle string
const ( CompletionStyleZsh CompletionStyle = "zsh" CompletionStyleBash CompletionStyle = "bash" CompletionStylePowershell CompletionStyle = "pwsh" CompletionStyleFish CompletionStyle = "fish" )
type PickerInstallResult ¶ added in v1.36.0
func InstallPicker ¶ added in v1.36.0
func InstallPicker(ctx context.Context, options PickerInstallation) (PickerInstallResult, error)
InstallPicker persists normal completion and the optional picker hook. The immutable script is committed before the profile; failed profile updates preserve scripts needed by an interrupted profile transaction. Cooperating writers serialize from validation through recovery. External editors do not share these locks: displaced profiles are retained, and publication never replaces an entry created by an editor during the transaction.
func RemovePicker ¶ added in v1.36.0
func RemovePicker(ctx context.Context, options PickerInstallation) (PickerInstallResult, error)
RemovePicker removes only an intact managed block and its verified script. Modified blocks or scripts are preserved and reported for manual inspection.
type PickerInstallation ¶ added in v1.36.0
type PickerInstallation struct {
Shell CompletionStyle
Directory string
Profile string
OptOutPath string // Optional shared marker for managed fish activation.
}
PickerInstallation contains only caller-selected paths. Shell discovery and consent belong to the command layer. Profile must be the startup file that this shell actually reads.
type ShellCompletion ¶
func NewShellCompletion ¶
func NewShellCompletion(name string, usage string) ShellCompletion
type ShellCompletionBehavior ¶
type ShellCompletionBehavior int
Source Files
¶
- autocomplete.go
- picker_fish_package.go
- picker_install.go
- picker_install_ancestry.go
- picker_install_ancestry_unix.go
- picker_install_cleanup.go
- picker_install_identity_other.go
- picker_install_identity_unix.go
- picker_install_links_unix.go
- picker_install_lock_unix.go
- picker_install_metadata.go
- picker_install_metadata_linux.go
- picker_install_metadata_unix.go
- picker_install_permissions_other.go
- picker_install_recovery.go
- picker_install_recovery_directory.go
- picker_install_recovery_directory_unix.go
- picker_install_rename.go
- picker_install_rename_linux.go
- picker_install_security_labels.go
- picker_script.go