feat: add quiet flag
1 file changed, 35 insertions(+), 0 deletions(-)
changed files
A output/output.go
@@ -0,0 +1,35 @@ +package output + +import ( + "io" + + "github.com/fatih/color" +) + +type Output struct { + Writer io.Writer + + fail, info, success *color.Color +} + +func New(writer io.Writer) Output { + return Output{ + Writer: writer, + + fail: color.New(color.FgRed), + info: color.New(), + success: color.New(color.FgGreen), + } +} + +func (o Output) Fail(format string, args ...any) { + o.fail.Fprintf(o.Writer, format, args...) +} + +func (o Output) Info(format string, args ...any) { + o.info.Fprintf(o.Writer, format, args...) +} + +func (o Output) Success(format string, args ...any) { + o.success.Fprintf(o.Writer, format, args...) +}