MCPcopy
hub / github.com/spf13/cobra / MarkFlagFilename

Function MarkFlagFilename

shell_completions.go:67–69  ·  view source on GitHub ↗

MarkFlagFilename instructs the various shell completion implementations to limit completions for the named flag to the specified file extensions.

(flags *pflag.FlagSet, name string, extensions ...string)

Source from the content-addressed store, hash-verified

65// MarkFlagFilename instructs the various shell completion implementations to
66// limit completions for the named flag to the specified file extensions.
67func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error {
68 return flags.SetAnnotation(name, BashCompFilenameExt, extensions)
69}
70
71// MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists.
72// The bash completion script will call the bash function f for the flag.

Callers 2

MarkFlagFilenameMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected