(ctx context.Context, args []string, input stream.Stream)
| 104 | const colorReset = "\033[0m" |
| 105 | |
| 106 | func (c Cli) Run(ctx context.Context, args []string, input stream.Stream) error { |
| 107 | err := c.run(ctx, args, input) |
| 108 | if err != nil { |
| 109 | message := err.Error() |
| 110 | if c.coloredOutput { |
| 111 | message = colorRed + err.Error() + colorReset |
| 112 | } |
| 113 | _, _ = fmt.Fprintln(c.stdErr, message) |
| 114 | } |
| 115 | return err |
| 116 | } |
| 117 | |
| 118 | func NewCli( |
| 119 | stdIn io.Reader, |