mirror of
https://github.com/go-task/task.git
synced 2025-07-03 00:57:02 +02:00
Merge pull request #877 from biozz/master
Fix task names for `--list` and `--list-all`
This commit is contained in:
2
help.go
2
help.go
@ -44,7 +44,7 @@ func (e *Executor) printTasks(listAll bool) {
|
|||||||
// Format in tab-separated columns with a tab stop of 8.
|
// Format in tab-separated columns with a tab stop of 8.
|
||||||
w := tabwriter.NewWriter(e.Stdout, 0, 8, 0, '\t', 0)
|
w := tabwriter.NewWriter(e.Stdout, 0, 8, 0, '\t', 0)
|
||||||
for _, task := range tasks {
|
for _, task := range tasks {
|
||||||
fmt.Fprintf(w, "* %s: \t%s\n", task.Name(), task.Desc)
|
fmt.Fprintf(w, "* %s: \t%s\n", task.Task, task.Desc)
|
||||||
}
|
}
|
||||||
w.Flush()
|
w.Flush()
|
||||||
}
|
}
|
||||||
|
@ -546,7 +546,7 @@ func TestLabelInSummary(t *testing.T) {
|
|||||||
assert.Contains(t, buff.String(), "foobar")
|
assert.Contains(t, buff.String(), "foobar")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLabelInList(t *testing.T) {
|
func TestNoLabelInList(t *testing.T) {
|
||||||
const dir = "testdata/label_list"
|
const dir = "testdata/label_list"
|
||||||
|
|
||||||
var buff bytes.Buffer
|
var buff bytes.Buffer
|
||||||
@ -557,7 +557,7 @@ func TestLabelInList(t *testing.T) {
|
|||||||
}
|
}
|
||||||
assert.NoError(t, e.Setup())
|
assert.NoError(t, e.Setup())
|
||||||
e.ListTasksWithDesc()
|
e.ListTasksWithDesc()
|
||||||
assert.Contains(t, buff.String(), "foobar")
|
assert.Contains(t, buff.String(), "foo")
|
||||||
}
|
}
|
||||||
|
|
||||||
// task -al case 1: listAll list all tasks
|
// task -al case 1: listAll list all tasks
|
||||||
|
Reference in New Issue
Block a user