Add --color=false flag to disable colored output

This commit is contained in:
Andrey Nering
2019-07-07 14:13:53 -03:00
parent fb23ba9878
commit 0e575e9c25
3 changed files with 12 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ func main() {
summary bool
dir string
output string
color bool
)
pflag.BoolVar(&versionFlag, "version", false, "show Task version")
@@ -74,6 +75,7 @@ func main() {
pflag.BoolVar(&summary, "summary", false, "show summary about a task")
pflag.StringVarP(&dir, "dir", "d", "", "sets directory of execution")
pflag.StringVarP(&output, "output", "o", "", "sets output style: [interleaved|group|prefixed]")
pflag.BoolVarP(&color, "color", "c", true, "colored output")
pflag.Parse()
if versionFlag {
@@ -100,6 +102,7 @@ func main() {
Dir: dir,
Dry: dry,
Summary: summary,
Color: color,
Stdin: os.Stdin,
Stdout: os.Stdout,