cobra
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
README¶
github.com/spf13/cobra
This package contains a copy of the Apache 2.0-licensed shell scripts that Cobrauses to integrate tab-completion into bash, zsh, fish and powershell, and theconstants that interface with them. We are re-using these scripts to implementsimilar tab-completion for ffcli and the standard library flag package.
The shell scripts were Go constants in the Cobra code, but we have extractedthem into separate files to facilitate gzipping them, and have removed theactiveHelp functionality from them.
Documentation¶
Overview¶
Package cobra contains shell scripts and constants copied fromhttps://github.com/spf13/cobra for use in our own shell tab-completion logic.
Index¶
- Constants
- func ScriptBash(w io.Writer, name, compCmd, nameForVar string) error
- func ScriptFish(w io.Writer, name, compCmd, nameForVar string) error
- func ScriptPowershell(w io.Writer, name, compCmd, nameForVar string) error
- func ScriptZsh(w io.Writer, name, compCmd, nameForVar string) error
- type ShellCompDirective
Constants¶
const UsageTemplate = ``/* 1233-byte string literal not displayed */Variables¶
This section is empty.
Functions¶
Types¶
typeShellCompDirective¶
type ShellCompDirectiveint
ShellCompDirective is a bit map representing the different behaviors the shellcan be instructed to have once completions have been provided.
const (// ShellCompDirectiveError indicates an error occurred and completions should be ignored.ShellCompDirectiveErrorShellCompDirective = 1 <<iota// ShellCompDirectiveNoSpace indicates that the shell should not add a space// after the completion even if there is a single completion provided.ShellCompDirectiveNoSpace// ShellCompDirectiveNoFileComp indicates that the shell should not provide// file completion even when no completion is provided.ShellCompDirectiveNoFileComp// ShellCompDirectiveFilterFileExt indicates that the provided completions// should be used as file extension filters.ShellCompDirectiveFilterFileExt// ShellCompDirectiveFilterDirs 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.ShellCompDirectiveFilterDirs// ShellCompDirectiveKeepOrder indicates that the shell should preserve the order// in which the completions are providedShellCompDirectiveKeepOrder// ShellCompDirectiveDefault 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.ShellCompDirectiveDefaultShellCompDirective = 0)
func (ShellCompDirective)String¶
func (dShellCompDirective) String()string
Returns a string listing the different directive enabled in the specified parameter