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

Method MarkFlagFilename

shell_completions.go:44–46  ·  view source on GitHub ↗

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

(name string, extensions ...string)

Source from the content-addressed store, hash-verified

42// MarkFlagFilename instructs the various shell completion implementations to
43// limit completions for the named flag to the specified file extensions.
44func (c *Command) MarkFlagFilename(name string, extensions ...string) error {
45 return MarkFlagFilename(c.Flags(), name, extensions...)
46}
47
48// MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists.
49// The bash completion script will call the bash function f for the flag.

Callers 2

TestBashCompletionsFunction · 0.95

Calls 2

FlagsMethod · 0.95
MarkFlagFilenameFunction · 0.85

Tested by 2

TestBashCompletionsFunction · 0.76