From c5a2e92e5e0ba8889a8db45c0a34647046a8c563 Mon Sep 17 00:00:00 2001 From: Pete Davison Date: Mon, 18 Dec 2023 09:45:41 +0000 Subject: [PATCH] feat: add aliases to --json output --- help.go | 5 +++++ internal/editors/output.go | 1 + 2 files changed, 6 insertions(+) diff --git a/help.go b/help.go index 7f4d3a91..863d4853 100644 --- a/help.go +++ b/help.go @@ -168,11 +168,16 @@ func (e *Executor) ToEditorOutput(tasks []*taskfile.Task, noStatus bool) (*edito for i := range tasks { task := tasks[i] j := i + aliases := []string{} + if len(task.Aliases) > 0 { + aliases = task.Aliases + } g.Go(func() error { o.Tasks[j] = editors.Task{ Name: task.Name(), Desc: task.Desc, Summary: task.Summary, + Aliases: aliases, UpToDate: false, Location: &editors.Location{ Line: task.Location.Line, diff --git a/internal/editors/output.go b/internal/editors/output.go index f2bab68a..42b893a1 100644 --- a/internal/editors/output.go +++ b/internal/editors/output.go @@ -11,6 +11,7 @@ type ( Name string `json:"name"` Desc string `json:"desc"` Summary string `json:"summary"` + Aliases []string `json:"aliases"` UpToDate bool `json:"up_to_date"` Location *Location `json:"location"` }