Help us shape the future of Go! Take the 2026 Go Developer Survey

autocomplete

package
v0.8.19 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package autocomplete implements dynamic shell auto-completion logic for earth targets, commands, and options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPotentials

func GetPotentials(
	ctx context.Context,
	resolver *buildcontext.Resolver,
	gwClient gwclient.Client,
	compLine string,
	compPoint int,
	app *cli.Command,
) ([]string, error)

GetPotentials returns a list of potential arguments for shell auto completion NOTE: you can cause earth to run this command with:

COMP_LINE="earth -" COMP_POINT=$(echo -n $COMP_LINE | wc -c) go run cmd/earth/main.go

func Log

func Log(s string)

Log writes a string to the log file.

func Logf

func Logf(format string, args ...any)

Logf writes a formatted string to the log file.

func SetupLog

func SetupLog(path string)

SetupLog enables debug-level logging in the autocomplete package when path is set to a logfile. this is particularly useful since autocompletion is called via a shell which can mangle stderr output and interprets stdout as autocompletion values.

Types

type FlagValuePotentialFn

type FlagValuePotentialFn func(ctx context.Context, prefix string) []string

FlagValuePotentialFn is a function that returns a list of potential arguments for a flag.

Jump to

Keyboard shortcuts

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