global verbose flag.

This commit is contained in:
fiatjaf
2025-01-30 16:06:16 -03:00
parent 81571c6952
commit df5ebd3f56
2 changed files with 18 additions and 5 deletions

View File

@@ -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()