| 303 | } |
| 304 | |
| 305 | func listHeader(repoName string, count, total int, state string) string { |
| 306 | switch state { |
| 307 | case stateOpen: |
| 308 | return fmt.Sprintf("Showing %d of %d open discussions in %s", count, total, repoName) |
| 309 | case stateClosed: |
| 310 | return fmt.Sprintf("Showing %d of %d closed discussions in %s", count, total, repoName) |
| 311 | default: |
| 312 | return fmt.Sprintf("Showing %d of %d discussions in %s", count, total, repoName) |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | func printDiscussions(opts *ListOptions, repoName string, discussions []client.Discussion, totalCount int) { |
| 317 | isTerminal := opts.IO.IsStdoutTTY() |