(buf io.StringWriter, cmd *Command)
| 613 | } |
| 614 | |
| 615 | func writeRequiredNouns(buf io.StringWriter, cmd *Command) { |
| 616 | WriteStringAndCheck(buf, " must_have_one_noun=()\n") |
| 617 | sort.Strings(cmd.ValidArgs) |
| 618 | for _, value := range cmd.ValidArgs { |
| 619 | // Remove any description that may be included following a tab character. |
| 620 | // Descriptions are not supported by bash completion. |
| 621 | value = strings.SplitN(value, "\t", 2)[0] |
| 622 | WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) |
| 623 | } |
| 624 | if cmd.ValidArgsFunction != nil { |
| 625 | WriteStringAndCheck(buf, " has_completion_function=1\n") |
| 626 | } |
| 627 | } |
| 628 | |
| 629 | func writeCmdAliases(buf io.StringWriter, cmd *Command) { |
| 630 | if len(cmd.Aliases) == 0 { |
no test coverage detected