mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
display task name on details
This commit is contained in:
8
task.go
8
task.go
@@ -65,7 +65,7 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
|
||||
}
|
||||
|
||||
if e.Details {
|
||||
e.displayTaskDetails(calls[0].Task)
|
||||
e.printTaskDetails(calls[0].Task)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -81,12 +81,16 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *Executor) displayTaskDetails(task string) {
|
||||
func (e *Executor) printTaskDetails(task string) {
|
||||
s := e.Taskfile.Tasks[task].Details
|
||||
if s == "" {
|
||||
e.Logger.Errf("task: There is no detailed description for task: %s", task)
|
||||
return
|
||||
}
|
||||
|
||||
e.Logger.Outf("task: " + task)
|
||||
e.Logger.Outf("")
|
||||
|
||||
lines := strings.Split(s, "\n")
|
||||
for i, line := range lines {
|
||||
notLastLine := i+1 < len(lines)
|
||||
|
||||
Reference in New Issue
Block a user