Documentation
¶
Overview ¶
Package complete implements the `task __complete` protocol consumed by the shell wrappers. It mirrors cobra v2 so a future migration stays cheap.
Index ¶
- Constants
- func Complete(e *task.Executor, fs *pflag.FlagSet, args []string, opts Options) ([]Suggestion, Directive)
- func IsActive() bool
- func NeedsTaskfile(args []string, fs *pflag.FlagSet) bool
- func Words() []string
- func Write(w io.Writer, suggs []Suggestion, dir Directive)
- type Directive
- type Options
- type Suggestion
Constants ¶
View Source
const ( FlagNoAliases = "--no-aliases" FlagNoDescriptions = "--no-descriptions" )
Control flags the shell wrappers prepend to the __complete invocation.
View Source
const CommandName = "__complete"
Variables ¶
This section is empty.
Functions ¶
func Complete ¶
func Complete(e *task.Executor, fs *pflag.FlagSet, args []string, opts Options) ([]Suggestion, Directive)
e may be nil when the Taskfile failed to load; flag completion still works.
Types ¶
type Directive ¶
type Directive int
Directive mirrors cobra's ShellCompDirective bitfield, emitted as `:<n>`.
const ( DirectiveDefault Directive = 0 // Never emitted: a failed Taskfile load still leaves flags worth completing. DirectiveError Directive = 1 << 0 DirectiveNoSpace Directive = 1 << 1 DirectiveNoFileComp Directive = 1 << 2 DirectiveFilterFileExt Directive = 1 << 3 DirectiveFilterDirs Directive = 1 << 4 DirectiveKeepOrder Directive = 1 << 5 )
type Options ¶
Named after the control flags, so the zero value is the standard set.
func ParseOptions ¶
Only leading flags are consumed; a `--no-aliases` typed later is left alone.
type Suggestion ¶
Click to show internal directories.
Click to hide internal directories.