diff --git a/helpers.go b/helpers.go index 38ab879..8caaef4 100644 --- a/helpers.go +++ b/helpers.go @@ -32,11 +32,11 @@ const ( LINE_PROCESSING_ERROR = iota ) -var log = func(msg string, args ...any) { - fmt.Fprintf(color.Error, msg, args...) -} - -var stdout = fmt.Println +var ( + log = func(msg string, args ...any) { fmt.Fprintf(color.Error, msg, args...) } + logverbose = func(msg string, args ...any) {} // by default do nothing + stdout = fmt.Println +) func isPiped() bool { stat, _ := os.Stdin.Stat() diff --git a/main.go b/main.go index 390548c..e08b059 100644 --- a/main.go +++ b/main.go @@ -63,6 +63,19 @@ var app = &cli.Command{ return nil }, }, + &cli.BoolFlag{ + Name: "verbose", + Usage: "print more stuff than normally", + Aliases: []string{"v"}, + Persistent: true, + Action: func(ctx context.Context, c *cli.Command, b bool) error { + v := c.Count("verbose") + if v >= 1 { + logverbose = log + } + return nil + }, + }, }, Before: func(ctx context.Context, c *cli.Command) error { configPath := c.String("config-path")