completion

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package completion supports bash completion for commands built using package flags.

References

* https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCompletion

func AddCompletion(value, description string, prefix string)

AddCompletion prints the possible completion if it matches the prefix.

func BashScript added in v0.7.0

func BashScript(w io.Writer, bin, name string) error

func FishScript added in v0.7.0

func FishScript(w io.Writer, bin, name string) error

func ZshScript added in v0.7.0

func ZshScript(w io.Writer, bin, name string) error

Types

type Env

type Env struct {
	Line  string
	Point int
	Type  int
	Key   int
}

Env contains the information passed by the shell in environment variables.

func (*Env) Init

func (env *Env) Init() bool

func (*Env) LeadingWords

func (env *Env) LeadingWords() []string

func (*Env) WriteCompletions

func (env *Env) WriteCompletions(command interface{}, words []string)

Jump to

Keyboard shortcuts

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