addListFlags registers the common --format / --no-color / --no-truncate flags on fs. Slugs are never truncated — only the freeform waiting field has a default cap, which --no-truncate disables.
(fs *flag.FlagSet)
| 29 | // flags on fs. Slugs are never truncated — only the freeform waiting field |
| 30 | // has a default cap, which --no-truncate disables. |
| 31 | func addListFlags(fs *flag.FlagSet) listOpts { |
| 32 | return listOpts{ |
| 33 | format: fs.String("format", "table", "output format: table|json|tsv"), |
| 34 | noColor: fs.Bool("no-color", false, "disable ANSI color even when stdout is a TTY"), |
| 35 | noTruncate: fs.Bool("no-truncate", false, "do not truncate the [waiting: ...] field in table output"), |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | // waitMax returns waitingMaxRunes when truncation is enabled, 0 otherwise. |
| 40 | func (o listOpts) waitMax() int { |
no test coverage detected