Documentation ¶
Index ¶
- func IsCallback() bool
- func Test(t testing)
- 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(c Context) Action) Action
- func ActionValues(values ...string) Action
- func ActionValuesDescribed(values ...string) Action
- type ActionMap
- type Carapace
- type CompletionCallback
- type Context
- 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 ¶
This section is empty.
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(c Context) 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 Context ¶ added in v0.4.0
type Context struct { // CallbackValue contains the (partial) value (or part of it during an ActionMultiParts) currently being completed CallbackValue string // Args contains the positional arguments of current (sub)command (exclusive the one currently being completed) Args []string // Parts contains the splitted CallbackValue during an ActionMultiParts (exclusive the part currently being completed) Parts []string }
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