Documentation
¶
Index ¶
- func ActionMacro(s string, a ...any) carapace.Action
- func ActionSpec(path string) carapace.Action
- func AddMacro(s string, m Macro, opts ...string)
- func AddMacroI[T any](f func(t T) carapace.Action, opts ...string)
- func AddMacroV[T any](f func(t ...T) carapace.Action, opts ...string)
- func Codegen(cmd *cobra.Command) error
- func NewAction(s []string) action
- func Register(cmd *cobra.Command)
- func Schema() string
- type Command
- type Macro
- type MacroMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionMacro ¶
ActionMacro completes given macro
func AddMacroI ¶ added in v1.6.1
AddMacroI adds a custom macro inferring the name from the function. Strips the ".../actions/" path prefix and "Action" function prefix. First string arg is description, any further strings are joined with "\n" as example.
Types ¶
type Macro ¶
type Macro struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Example string `json:"example,omitempty"`
Function string `json:"function,omitempty"`
Args string `json:"args,omitempty"` // TODO shouldn't be necessary
Macro macro.Macro[carapace.Action] `json:"-"` // TODO public?
}
TODO lots of overlapping `macro` terms. Macro[I|V|N] don't match the embedded generic `macro.Macro` well.
type MacroMap ¶ added in v1.5.0
func ScanMacros ¶ added in v1.5.0
TODO experimental - internal use
Source Files
¶
Click to show internal directories.
Click to hide internal directories.