Documentation
¶
Overview ¶
The constants in this file are taken from https://github.com/spf13/cobra/blob/v1.5.0/completions.go
Cobra defines a completion API so that generic completion logic can be written once for Bash and Zsh that invokes a CLI with `--complete --` and passes the inputs to be completed.
The CLI is expected to write suggestions to Standard Output as well as a Shell Completion Directive, which is an integer that stacks one or more bit flags.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Directive ¶
type Directive int
Directive is a bit map representing the different behaviors the shell can be instructed to have once completions have been provided.
const ( // DirectiveError indicates an error occurred and completions should be ignored. DirectiveError Directive = 1 << iota // DirectiveNoSpace indicates that the shell should not add a space // after the completion even if there is a single completion provided. // Used when a flag ends with '='. DirectiveNoSpace // DirectiveNoFileComp indicates that the shell should not provide // file completion even when no completion is provided. DirectiveNoFileComp // DirectiveFilterFileExt indicates that the provided completions // should be used as file extension filters. // For flags, using Command.MarkFlagFilename() and Command.MarkPersistentFlagFilename() // is a shortcut to using this directive explicitly. The BashCompFilenameExt // annotation can also be used to obtain the same behavior for flags. DirectiveFilterFileExt // DirectiveFilterDirs indicates that only directory names should // be provided in file completion. To request directory names within another // directory, the returned completions should specify the directory within // which to search. The BashCompSubdirsInDir annotation can be used to // obtain the same behavior but only for flags. DirectiveFilterDirs // DirectiveDefault indicates to let the shell perform its default // behavior after completions have been provided. // This one must be last to avoid messing up the iota count. DirectiveDefault Directive = 0 )
Click to show internal directories.
Click to hide internal directories.