(arg string)
| 779 | } |
| 780 | |
| 781 | func (c *Command) findSuggestions(arg string) string { |
| 782 | if c.DisableSuggestions { |
| 783 | return "" |
| 784 | } |
| 785 | if c.SuggestionsMinimumDistance <= 0 { |
| 786 | c.SuggestionsMinimumDistance = 2 |
| 787 | } |
| 788 | var sb strings.Builder |
| 789 | if suggestions := c.SuggestionsFor(arg); len(suggestions) > 0 { |
| 790 | sb.WriteString("\n\nDid you mean this?\n") |
| 791 | for _, s := range suggestions { |
| 792 | _, _ = fmt.Fprintf(&sb, "\t%v\n", s) |
| 793 | } |
| 794 | } |
| 795 | return sb.String() |
| 796 | } |
| 797 | |
| 798 | func (c *Command) findNext(next string) *Command { |
| 799 | matches := make([]*Command, 0) |
no test coverage detected