From 122c3f083e293b915c943928b997e1bad225b01e Mon Sep 17 00:00:00 2001 From: Ivan Elfimov Date: Fri, 30 Sep 2022 19:02:50 +0400 Subject: [PATCH 1/2] Fix task names for `--list` and `--list-all` Task names should not be overrided by `label`. --- help.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/help.go b/help.go index 85ce0ce7..612e45b3 100644 --- a/help.go +++ b/help.go @@ -44,7 +44,7 @@ func (e *Executor) printTasks(listAll bool) { // Format in tab-separated columns with a tab stop of 8. w := tabwriter.NewWriter(e.Stdout, 0, 8, 0, '\t', 0) 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() } From b9d070f76b3472b177376b8a09a26843ad42fb60 Mon Sep 17 00:00:00 2001 From: Ivan Elfimov Date: Fri, 30 Sep 2022 19:17:04 +0400 Subject: [PATCH 2/2] Fix test related to task lables --- task_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/task_test.go b/task_test.go index 72357095..9602a6c0 100644 --- a/task_test.go +++ b/task_test.go @@ -546,7 +546,7 @@ func TestLabelInSummary(t *testing.T) { assert.Contains(t, buff.String(), "foobar") } -func TestLabelInList(t *testing.T) { +func TestNoLabelInList(t *testing.T) { const dir = "testdata/label_list" var buff bytes.Buffer @@ -557,7 +557,7 @@ func TestLabelInList(t *testing.T) { } assert.NoError(t, e.Setup()) e.ListTasksWithDesc() - assert.Contains(t, buff.String(), "foobar") + assert.Contains(t, buff.String(), "foo") } // task -al case 1: listAll list all tasks