Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetGlobals ¶
func SetGlobals(l ambient.AppLogger, r *requestclient.RequestClient)
SetGlobals will set the variables used by the package.
Types ¶
type CmdBase ¶
type CmdBase struct{}
CmdBase is a base object for structs. This reduces creating methods that are optional and provides methods all can be used.
func (*CmdBase) ArgumentSuggestions ¶
func (c *CmdBase) ArgumentSuggestions() SmartSuggestGroup
ArgumentSuggestions returns a smart suggestion group that includes validation.
type CmdCreateApp ¶
type CmdCreateApp struct {
CmdBase
}
CmdCreateApp represents a command object.
func (*CmdCreateApp) ArgumentSuggestions ¶
func (c *CmdCreateApp) ArgumentSuggestions() SmartSuggestGroup
ArgumentSuggestions returns a smart suggestion group that includes validation.
func (*CmdCreateApp) Command ¶
func (c *CmdCreateApp) Command() string
Command returns the initial command.
func (*CmdCreateApp) Completer ¶
func (c *CmdCreateApp) Completer(d prompt.Document, args []string) []prompt.Suggest
Completer returns a list of suggestions based on the user input.
func (*CmdCreateApp) Executer ¶
func (c *CmdCreateApp) Executer(args []string)
Executer executes the command.
func (*CmdCreateApp) Suggestion ¶
func (c *CmdCreateApp) Suggestion() prompt.Suggest
Suggestion returns the suggestion for the initial command.
type CmdCreatePlugin ¶
type CmdCreatePlugin struct {
CmdBase
}
CmdCreatePlugin represents a command object.
func (*CmdCreatePlugin) ArgumentSuggestions ¶
func (c *CmdCreatePlugin) ArgumentSuggestions() SmartSuggestGroup
ArgumentSuggestions returns a smart suggestion group that includes validation.
func (*CmdCreatePlugin) Command ¶
func (c *CmdCreatePlugin) Command() string
Command returns the initial command.
func (*CmdCreatePlugin) Completer ¶
func (c *CmdCreatePlugin) Completer(d prompt.Document, args []string) []prompt.Suggest
Completer returns a list of suggestions based on the user input.
func (*CmdCreatePlugin) Executer ¶
func (c *CmdCreatePlugin) Executer(args []string)
Executer executes the command.
func (*CmdCreatePlugin) Suggestion ¶
func (c *CmdCreatePlugin) Suggestion() prompt.Suggest
Suggestion returns the suggestion for the initial command.
type CmdDecrypt ¶
type CmdDecrypt struct {
CmdBase
}
CmdDecrypt represents a command object.
func (*CmdDecrypt) Command ¶
func (c *CmdDecrypt) Command() string
Command returns the initial command.
func (*CmdDecrypt) Completer ¶
func (c *CmdDecrypt) Completer(d prompt.Document, args []string) []prompt.Suggest
Completer returns a list of suggestions based on the user input.
func (*CmdDecrypt) Executer ¶
func (c *CmdDecrypt) Executer(args []string)
Executer executes the command.
func (*CmdDecrypt) Suggestion ¶
func (c *CmdDecrypt) Suggestion() prompt.Suggest
Suggestion returns the suggestion for the initial command.
type CmdEnable ¶
type CmdEnable struct {
CmdBase
}
CmdEnable represents a command object.
func (*CmdEnable) Suggestion ¶
func (c *CmdEnable) Suggestion() prompt.Suggest
Suggestion returns the suggestion for the initial command.
type CmdEncrypt ¶
type CmdEncrypt struct {
CmdBase
}
CmdEncrypt represents a command object.
func (*CmdEncrypt) Command ¶
func (c *CmdEncrypt) Command() string
Command returns the initial command.
func (*CmdEncrypt) Completer ¶
func (c *CmdEncrypt) Completer(d prompt.Document, args []string) []prompt.Suggest
Completer returns a list of suggestions based on the user input.
func (*CmdEncrypt) Executer ¶
func (c *CmdEncrypt) Executer(args []string)
Executer executes the command.
func (*CmdEncrypt) Suggestion ¶
func (c *CmdEncrypt) Suggestion() prompt.Suggest
Suggestion returns the suggestion for the initial command.
type CmdExit ¶
type CmdExit struct {
CmdBase
}
CmdExit represents a command object.
func (*CmdExit) Suggestion ¶
func (c *CmdExit) Suggestion() prompt.Suggest
Suggestion returns the suggestion for the initial command.
type CmdGrant ¶
type CmdGrant struct {
CmdBase
}
CmdGrant represents a command object.
func (*CmdGrant) Suggestion ¶
func (c *CmdGrant) Suggestion() prompt.Suggest
Suggestion returns the suggestion for the initial command.
type Command ¶
type Command interface { Command() string Suggestion() prompt.Suggest Executer(args []string) Completer(d prompt.Document, args []string) []prompt.Suggest ArgumentSuggestions() SmartSuggestGroup }
Command represents all the information required to run a command, including suggestions.
type CommandList ¶
type CommandList struct {
// contains filtered or unexported fields
}
CommandList is a collection of commands.
func NewCommandList ¶
func NewCommandList() *CommandList
NewCommandList returns a new collection of commands.
func (*CommandList) Completer ¶
func (cl *CommandList) Completer(d prompt.Document) []prompt.Suggest
Completer handles the auto completion.
func (*CommandList) Executer ¶
func (cl *CommandList) Executer(s string)
Executer executes the typed in command.
func (*CommandList) InitialCommandSuggestions ¶
func (cl *CommandList) InitialCommandSuggestions() []prompt.Suggest
InitialCommandSuggestions returns a list of the initial or top-level commands.
type SmartSuggest ¶
type SmartSuggest struct { prompt.Suggest Required bool }
SmartSuggest is an advanced struct that has additional properties.
type SmartSuggestGroup ¶
type SmartSuggestGroup []SmartSuggest
SmartSuggestGroup is a group.
func (SmartSuggestGroup) ToSuggest ¶
func (g SmartSuggestGroup) ToSuggest() []prompt.Suggest
ToSuggest returns an array of suggestions.