completion

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Escape

func Escape(s string) string

Escape escapes a string according to completion rules (?) in effect, this means that the string will be quoted with double quotes if it contains a space or parentheses.

func MatchStringPrefix

func MatchStringPrefix(vals []string, key string, caseSensitive bool) []string

MatchStringPrefix returns a list of string in vals which have a prefix as specified in key. Quotes are removed from key and output strings are escaped according to completion rules

func None

None is a fallback with no completion, for error cases etc.

Types

type Database added in v1.4.0

type Database struct {
}

Database implements argument completion for databases, by uuid or title.

func (Database) CompleteArgument added in v1.4.0

func (s Database) CompleteArgument(svc service.AllServices, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteArgument implements completion.Provider

type IPAddress

type IPAddress struct {
}

IPAddress implements argument completion for ip addresses, by ptr record or the adddress itself

func (IPAddress) CompleteArgument

func (s IPAddress) CompleteArgument(svc service.AllServices, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteArgument implements completion.Provider

type LoadBalancer added in v1.4.0

type LoadBalancer struct {
}

LoadBalancer implements argument completion for load balancers, by uuid or name.

func (LoadBalancer) CompleteArgument added in v1.4.0

func (s LoadBalancer) CompleteArgument(svc service.AllServices, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteArgument implements completion.Provider

type Network

type Network struct {
}

Network implements argument completion for networks, by name or uuid.

func (Network) CompleteArgument

func (s Network) CompleteArgument(svc service.AllServices, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteArgument implements completion.Provider

type Provider

type Provider interface {
	CompleteArgument(svc service.AllServices, toComplete string) ([]string, cobra.ShellCompDirective)
}

Provider should be implemented by a command that can provide argument completion

type Router

type Router struct {
}

Router implements argument completion for routers, by name or uuid.

func (Router) CompleteArgument

func (s Router) CompleteArgument(svc service.AllServices, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteArgument implements completion.Provider

type Server

type Server struct {
}

Server implements argument completion for routers, by uuid, name or hostname.

func (Server) CompleteArgument

func (s Server) CompleteArgument(svc service.AllServices, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteArgument implements completion.Provider

type Storage

type Storage struct {
}

Storage implements argument completion for routers, by uuid, name or hostname.

func (Storage) CompleteArgument

func (s Storage) CompleteArgument(svc service.AllServices, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteArgument implements completion.Provider

Jump to

Keyboard shortcuts

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