ToFishCompletion creates a fish completion string for the `*Command` The function errors if either parsing or writing of the string fails.
()
| 11 | // ToFishCompletion creates a fish completion string for the `*Command` |
| 12 | // The function errors if either parsing or writing of the string fails. |
| 13 | func (cmd *Command) ToFishCompletion() (string, error) { |
| 14 | var w bytes.Buffer |
| 15 | if err := cmd.writeFishCompletionTemplate(&w); err != nil { |
| 16 | return "", err |
| 17 | } |
| 18 | return w.String(), nil |
| 19 | } |
| 20 | |
| 21 | type fishCommandCompletionTemplate struct { |
| 22 | Command *Command |