completion

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directive

type Directive int

Directive tells the shell what to do after candidate display.

const (
	// DirectiveDefault means display the candidates produced by this call.
	DirectiveDefault Directive = 0
	// DirectiveFiles means fall back to native file-path completion.
	DirectiveFiles Directive = 1
)

type NameDesc

type NameDesc struct {
	Name        string
	Description string
}

NameDesc is a name/description pair (e.g. an environment from config).

type Result

type Result struct {
	Candidates []string
	Directive  Directive
}

Result holds completion candidates and a shell directive. Each candidate is formatted as "value" or "value\tdescription".

func Complete

func Complete(words []string, envNames []NameDesc, cmdNames ...NameDesc) Result

Complete computes shell completion candidates for the typed words.

words contains the arguments typed so far, with the program name excluded. The last element is the partial word currently being completed (may be ""). envNames provides environment names and descriptions loaded from the offline config (no daemon required). cmdNames optionally provides command names for completing "env-starter command restart <TAB>"; existing callers that only deal with environments can omit it.

Jump to

Keyboard shortcuts

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