mirror of
https://github.com/go-task/task.git
synced 2025-01-12 04:34:11 +02:00
abb19dfbf8
also, don't print up-to-date status when the --silent flag was given closes #68
32 lines
564 B
Go
32 lines
564 B
Go
package task
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func (e *Executor) outf(s string, args ...interface{}) {
|
|
if len(args) == 0 {
|
|
s, args = "%s", []interface{}{s}
|
|
}
|
|
fmt.Fprintf(e.Stdout, s+"\n", args...)
|
|
}
|
|
|
|
func (e *Executor) verboseOutf(s string, args ...interface{}) {
|
|
if e.Verbose {
|
|
e.outf(s, args...)
|
|
}
|
|
}
|
|
|
|
func (e *Executor) errf(s string, args ...interface{}) {
|
|
if len(args) == 0 {
|
|
s, args = "%s", []interface{}{s}
|
|
}
|
|
fmt.Fprintf(e.Stderr, s+"\n", args...)
|
|
}
|
|
|
|
func (e *Executor) verboseErrf(s string, args ...interface{}) {
|
|
if e.Verbose {
|
|
e.errf(s, args...)
|
|
}
|
|
}
|