1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

Use colors for some output messages

This commit is contained in:
Andrey Nering
2019-05-26 18:36:39 -03:00
parent 6ff9ba9df9
commit 8efc38ad82
11 changed files with 75 additions and 42 deletions

View File

@@ -5,6 +5,7 @@ import (
"sort"
"text/tabwriter"
"github.com/go-task/task/v2/internal/logger"
"github.com/go-task/task/v2/internal/taskfile"
)
@@ -12,10 +13,10 @@ import (
func (e *Executor) PrintTasksHelp() {
tasks := e.tasksWithDesc()
if len(tasks) == 0 {
e.Logger.Outf("task: No tasks with description available")
e.Logger.Outf(logger.Yellow, "task: No tasks with description available")
return
}
e.Logger.Outf("task: Available tasks for this project:")
e.Logger.Outf(logger.Default, "task: Available tasks for this project:")
// Format in tab-separated columns with a tab stop of 8.
w := tabwriter.NewWriter(e.Stdout, 0, 8, 0, '\t', 0)