(out io.Writer)
| 97 | } |
| 98 | |
| 99 | func (u *UsageEntries) DisplayEntries(out io.Writer) { |
| 100 | for _, e := range u.entries { |
| 101 | if e.Title != "" { |
| 102 | // If there is a title, add indentation to each line in the body |
| 103 | fmt.Fprintln(out, e.Title) |
| 104 | fmt.Fprintln(out, text.Indent(strings.Trim(e.Body, "\r\n"), " ")) |
| 105 | } else { |
| 106 | // If there is no title print the body as is |
| 107 | fmt.Fprintln(out, e.Body) |
| 108 | } |
| 109 | fmt.Fprintln(out) |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | func UsageFunc( |
| 114 | IOStreams *iostreams.IOStreams, |
no test coverage detected