(s string)
| 39 | } |
| 40 | |
| 41 | func (f *Format) Set(s string) error { |
| 42 | var v Format |
| 43 | switch s { |
| 44 | case "human": |
| 45 | v = FormatHuman |
| 46 | case "json": |
| 47 | v = FormatJSON |
| 48 | case "csv": |
| 49 | v = FormatCSV |
| 50 | default: |
| 51 | return fmt.Errorf("failed to parse Format: %q. Valid values: %+v", s, []string{"human", "json", "csv"}) |
| 52 | } |
| 53 | *f = v |
| 54 | return nil |
| 55 | } |
| 56 | |
| 57 | var ( |
| 58 | ColorBold = color.New(color.Bold) |
no test coverage detected