add verbose mode (-v flag)

This commit is contained in:
Andrey Nering
2017-07-05 20:55:50 -03:00
parent a1d1f73fe7
commit 222b5cb587
4 changed files with 24 additions and 7 deletions

12
log.go
View File

@@ -11,3 +11,15 @@ func (e *Executor) println(args ...interface{}) {
func (e *Executor) printfln(format string, args ...interface{}) {
fmt.Fprintf(e.Stdout, format+"\n", args...)
}
func (e *Executor) verbosePrintln(args ...interface{}) {
if e.Verbose {
e.println(args...)
}
}
func (e *Executor) verbosePrintfln(format string, args ...interface{}) {
if e.Verbose {
e.printfln(format, args...)
}
}