completers

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package completers provides specialized completion sources for different types of input.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltinCommand

type BuiltinCommand struct {
	Name        string
	Description string
	Help        string
}

BuiltinCommand represents a built-in command with its help text.

type BuiltinCompleter

type BuiltinCompleter struct {
	// contains filtered or unexported fields
}

BuiltinCompleter provides completions for built-in commands (prefixed with #!).

func NewBuiltinCompleter

func NewBuiltinCompleter() *BuiltinCompleter

NewBuiltinCompleter creates a new BuiltinCompleter with default commands.

func (*BuiltinCompleter) GetCompletions

func (c *BuiltinCompleter) GetCompletions(prefix string) []string

GetCompletions returns built-in command completions for the given prefix.

func (*BuiltinCompleter) GetHelp

func (c *BuiltinCompleter) GetHelp(command string) string

GetHelp returns help information for a built-in command.

type CommandCompleter

type CommandCompleter struct {
	// contains filtered or unexported fields
}

CommandCompleter provides completions for system commands, aliases, and executables.

func NewCommandCompleter

func NewCommandCompleter(runner *interp.Runner, pwdGetter func() string, fileCompleter FileCompleterFunc) *CommandCompleter

NewCommandCompleter creates a new CommandCompleter.

func (*CommandCompleter) GetAliasCompletions

func (c *CommandCompleter) GetAliasCompletions(prefix string) []string

GetAliasCompletions returns shell aliases that match the given prefix.

func (*CommandCompleter) GetAvailableCommands

func (c *CommandCompleter) GetAvailableCommands(prefix string) []string

GetAvailableCommands returns available system commands that match the given prefix.

func (*CommandCompleter) GetExecutableCompletions

func (c *CommandCompleter) GetExecutableCompletions(pathPrefix string) []string

GetExecutableCompletions returns executable files and directories that match the given path prefix. Directories are included so users can navigate into them.

func (*CommandCompleter) IsPathBasedCommand

func (c *CommandCompleter) IsPathBasedCommand(command string) bool

IsPathBasedCommand determines if a command looks like a path rather than a simple command name.

type FileCompleterFunc added in v1.1.6

type FileCompleterFunc func(prefix string, currentDirectory string) []string

FileCompleterFunc is the signature for a file completion function.

type MacroCompleter

type MacroCompleter struct {
	// contains filtered or unexported fields
}

MacroCompleter provides completions for macros (prefixed with #/).

func NewMacroCompleter

func NewMacroCompleter(runner *interp.Runner) *MacroCompleter

NewMacroCompleter creates a new MacroCompleter.

func (*MacroCompleter) GetCompletions

func (c *MacroCompleter) GetCompletions(prefix string) []string

GetCompletions returns macro completions for the given prefix.

func (*MacroCompleter) GetHelp

func (c *MacroCompleter) GetHelp(macroName string) string

GetHelp returns help information for a macro.

Jump to

Keyboard shortcuts

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