predict

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 4 Imported by: 3

Documentation

Overview

Package predict holds the completion predictors a command tree is built from.

Index

Constants

This section is empty.

Variables

Nothing predicts no completions, which is what a boolean flag wants.

View Source
var Something complete.Predictor = complete.PredictFunc(
	func(string) []string { return nil },
)

Something predicts nothing but marks a flag as taking a value, so the shell does not fall back to offering subcommands where an argument belongs.

Functions

func Dirs

func Dirs(pattern string) complete.Predictor

Dirs predicts directories only.

func Files

func Files(pattern string) complete.Predictor

Files predicts paths matching a glob pattern, as "*.mmdb". Use "*" for any file.

Directories are always offered whatever the pattern, since a path into a directory has to be typed before the file inside it can match.

func Func

func Func(f func(prefix string) []string) complete.Predictor

Func adapts a function to a Predictor.

func Set

func Set(options []string) complete.Predictor

Set predicts one of a fixed list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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