Documentation ¶
Overview ¶
Package carapace provides multi-shell completion script generation for spf13/cobra
Index ¶
- Variables
- func IsCallback() bool
- type Action
- func ActionBool() Action
- func ActionCallback(callback CompletionCallback) Action
- func ActionDirectories() Action
- func ActionFiles(suffix string) Action
- func ActionMessage(msg string) Action
- func ActionMultiParts(divider string, callback func(args []string, parts []string) Action) Action
- func ActionValues(values ...string) Action
- func ActionValuesDescribed(values ...string) Action
- type ActionMap
- type Carapace
- type CompletionCallback
- type InvokedAction
- func (a InvokedAction) Filter(values []string) InvokedAction
- func (a InvokedAction) Merge(others ...InvokedAction) InvokedAction
- func (a InvokedAction) Prefix(prefix string) InvokedAction
- func (a InvokedAction) Suffix(suffix string) InvokedAction
- func (a InvokedAction) ToA() Action
- func (a InvokedAction) ToMultiPartsA(divider string) Action
Constants ¶
This section is empty.
Variables ¶
var CallbackValue string
CallbackValue is set to the currently completed flag/positional value during callback (note that this is updated during ActionMultiParts)
Functions ¶
func IsCallback ¶ added in v0.0.6
func IsCallback() bool
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action indicates how to complete a flag or positional argument
func ActionCallback ¶
func ActionCallback(callback CompletionCallback) Action
ActionCallback invokes a go function during completion
func ActionDirectories ¶ added in v0.0.11
func ActionDirectories() Action
ActionDirectories completes directories
func ActionFiles ¶
ActionFiles completes files with optional suffix filtering
func ActionMessage ¶
ActionMessage displays a help messages in places where no completions can be generated
func ActionMultiParts ¶
ActionMultiParts completes multiple parts of words separately where each part is separated by some char (CallbackValue is set to the currently completed part during invocation)
func ActionValues ¶
ActionValues completes arbitrary keywords (values)
func ActionValuesDescribed ¶
ActionValuesDescribed completes arbitrary key (values) with an additional description (value, description pairs)
func (Action) Invoke ¶ added in v0.1.1
func (a Action) Invoke(args []string) InvokedAction
Invoke executes the callback of an action if it exists (supports nesting)
type Carapace ¶
type Carapace struct {
// contains filtered or unexported fields
}
func (Carapace) FlagCompletion ¶
func (Carapace) PositionalAnyCompletion ¶ added in v0.0.14
func (Carapace) PositionalCompletion ¶
func (Carapace) Standalone ¶ added in v0.0.14
func (c Carapace) Standalone()
type CompletionCallback ¶
type InvokedAction ¶ added in v0.1.1
type InvokedAction Action
func (InvokedAction) Filter ¶ added in v0.1.1
func (a InvokedAction) Filter(values []string) InvokedAction
func (InvokedAction) Merge ¶ added in v0.1.8
func (a InvokedAction) Merge(others ...InvokedAction) InvokedAction
func (InvokedAction) Prefix ¶ added in v0.1.1
func (a InvokedAction) Prefix(prefix string) InvokedAction
func (InvokedAction) Suffix ¶ added in v0.1.1
func (a InvokedAction) Suffix(suffix string) InvokedAction
func (InvokedAction) ToA ¶ added in v0.1.1
func (a InvokedAction) ToA() Action
func (InvokedAction) ToMultiPartsA ¶ added in v0.2.2
func (a InvokedAction) ToMultiPartsA(divider string) Action