1
0
mirror of https://github.com/writeas/writeas-cli synced 2025-07-26 23:08:16 +00:00

log.Info will respect global flags

This commit is contained in:
Rob Loranger 2019-08-02 11:09:02 -07:00
parent 55dcf5e79c
commit 941d234395
No known key found for this signature in database
GPG Key ID: D6F1633A4F0903B8

View File

@ -10,7 +10,7 @@ import (
// Info logs general diagnostic messages, shown only when the -v or --verbose // Info logs general diagnostic messages, shown only when the -v or --verbose
// flag is provided. // flag is provided.
func Info(c *cli.Context, s string, p ...interface{}) { func Info(c *cli.Context, s string, p ...interface{}) {
if c.Bool("v") || c.Bool("verbose") { if c.Bool("v") || c.Bool("verbose") || c.GlobalBool("v") || c.GlobalBool("verbose") {
fmt.Fprintf(os.Stderr, s+"\n", p...) fmt.Fprintf(os.Stderr, s+"\n", p...)
} }
} }