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

Method GenFishCompletion

fish_completions.go:276–281  ·  view source on GitHub ↗

GenFishCompletion generates fish completion file and writes to the passed writer.

(w io.Writer, includeDesc bool)

Source from the content-addressed store, hash-verified

274
275// GenFishCompletion generates fish completion file and writes to the passed writer.
276func (c *Command) GenFishCompletion(w io.Writer, includeDesc bool) error {
277 buf := new(bytes.Buffer)
278 genFishComp(buf, c.Name(), includeDesc)
279 _, err := buf.WriteTo(w)
280 return err
281}
282
283// GenFishCompletionFile generates fish completion file.
284func (c *Command) GenFishCompletionFile(filename string, includeDesc bool) error {

Callers 7

GenFishCompletionFileMethod · 0.95
TestProgWithDashFunction · 0.95
TestProgWithColonFunction · 0.95

Calls 2

NameMethod · 0.95
genFishCompFunction · 0.85

Tested by 5

TestProgWithDashFunction · 0.76
TestProgWithColonFunction · 0.76