mirror of
https://github.com/go-task/task.git
synced 2025-03-03 14:52:13 +02:00
feat: add aliases to --json output
This commit is contained in:
parent
edb9dcd284
commit
c5a2e92e5e
5
help.go
5
help.go
@ -168,11 +168,16 @@ func (e *Executor) ToEditorOutput(tasks []*taskfile.Task, noStatus bool) (*edito
|
|||||||
for i := range tasks {
|
for i := range tasks {
|
||||||
task := tasks[i]
|
task := tasks[i]
|
||||||
j := i
|
j := i
|
||||||
|
aliases := []string{}
|
||||||
|
if len(task.Aliases) > 0 {
|
||||||
|
aliases = task.Aliases
|
||||||
|
}
|
||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
o.Tasks[j] = editors.Task{
|
o.Tasks[j] = editors.Task{
|
||||||
Name: task.Name(),
|
Name: task.Name(),
|
||||||
Desc: task.Desc,
|
Desc: task.Desc,
|
||||||
Summary: task.Summary,
|
Summary: task.Summary,
|
||||||
|
Aliases: aliases,
|
||||||
UpToDate: false,
|
UpToDate: false,
|
||||||
Location: &editors.Location{
|
Location: &editors.Location{
|
||||||
Line: task.Location.Line,
|
Line: task.Location.Line,
|
||||||
|
@ -11,6 +11,7 @@ type (
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Desc string `json:"desc"`
|
Desc string `json:"desc"`
|
||||||
Summary string `json:"summary"`
|
Summary string `json:"summary"`
|
||||||
|
Aliases []string `json:"aliases"`
|
||||||
UpToDate bool `json:"up_to_date"`
|
UpToDate bool `json:"up_to_date"`
|
||||||
Location *Location `json:"location"`
|
Location *Location `json:"location"`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user