Documentation
¶
Overview ¶
Package cobraz contains supplemental logic for dealing with spf13/cobra.
Index ¶
Constants ¶
View Source
const ( ShellCompDirectiveErrorText = "ShellCompDirectiveError" ShellCompDirectiveNoSpaceText = "ShellCompDirectiveNoSpace" ShellCompDirectiveNoFileCompText = "ShellCompDirectiveNoFileComp" ShellCompDirectiveFilterFileExtText = "ShellCompDirectiveFilterFileExt" ShellCompDirectiveFilterDirsText = "ShellCompDirectiveFilterDirs" ShellCompDirectiveKeepOrderText = "ShellCompDirectiveKeepOrder" ShellCompDirectiveDefaultText = "ShellCompDirectiveDefault" ShellCompDirectiveUnknownText = "ShellCompDirectiveUnknown" )
Defines the text values for cobra.ShellCompDirective.
Variables ¶
This section is empty.
Functions ¶
func ExtractDirectives ¶
func ExtractDirectives(result cobra.ShellCompDirective) []cobra.ShellCompDirective
ExtractDirectives extracts the individual directives from a combined directive.
func MarshalDirective ¶
func MarshalDirective(directive cobra.ShellCompDirective) []string
MarshalDirective marshals a cobra.ShellCompDirective to text strings, after extracting the embedded directives.
func ParseDirectivesLine ¶
func ParseDirectivesLine(directivesLine string) []cobra.ShellCompDirective
ParseDirectivesLine parses the line of text returned by "__complete" cmd that contains the text description of the result. The line looks like:
Completion ended with directive: ShellCompDirectiveNoSpace, ShellCompDirectiveKeepOrder
Note that this function will panic on an unknown directive.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.