mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
allow custom Stdin, Stdout and Stderr while running as a lib
This commit is contained in:
5
help.go
5
help.go
@@ -2,7 +2,6 @@ package task
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"text/tabwriter"
|
||||
)
|
||||
@@ -12,10 +11,10 @@ func (e *Executor) printExistingTasksHelp() {
|
||||
if len(tasks) == 0 {
|
||||
return
|
||||
}
|
||||
fmt.Println("Available tasks for this project:")
|
||||
e.println("Available tasks for this project:")
|
||||
|
||||
// Format in tab-separated columns with a tab stop of 8.
|
||||
w := tabwriter.NewWriter(os.Stdout, 0, 8, 0, '\t', 0)
|
||||
w := tabwriter.NewWriter(e.Stdout, 0, 8, 0, '\t', 0)
|
||||
for _, task := range tasks {
|
||||
fmt.Fprintln(w, fmt.Sprintf("- %s:\t%s", task, e.Tasks[task].Desc))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user