MCPcopy Create free account
hub / github.com/driangle/taskmd / buildGetOutput

Function buildGetOutput

apps/cli/internal/cli/get.go:555–585  ·  view source on GitHub ↗
(task *model.Task, deps dependencyInfo, ctxFiles []taskcontext.FileEntry, wl *worklogInfo)

Source from the content-addressed store, hash-verified

553}
554
555func buildGetOutput(task *model.Task, deps dependencyInfo, ctxFiles []taskcontext.FileEntry, wl *worklogInfo) getOutput {
556 created := ""
557 if !task.Created.IsZero() {
558 created = task.Created.Format("2006-01-02")
559 }
560 out := getOutput{
561 ID: task.ID,
562 Title: task.Title,
563 Status: string(task.Status),
564 Priority: string(task.Priority),
565 Effort: string(task.Effort),
566 Type: string(task.Type),
567 Phase: task.Phase,
568 Tags: task.Tags,
569 PRs: task.PRs,
570 Parent: deps.Parent,
571 Created: created,
572 FilePath: task.FilePath,
573 Content: strings.TrimSpace(task.Body),
574 Dependencies: getDepsJSON{
575 DependsOn: deps.DependsOn,
576 Blocks: deps.Blocks,
577 },
578 Children: deps.Children,
579 Worklog: wl,
580 }
581 if len(ctxFiles) > 0 {
582 out.ContextFiles = ctxFiles
583 }
584 return out
585}
586
587func outputGetJSON(task *model.Task, deps dependencyInfo, ctxFiles []taskcontext.FileEntry, wl *worklogInfo, w io.Writer) error {
588 return WriteJSON(w, buildGetOutput(task, deps, ctxFiles, wl))

Callers 2

outputGetJSONFunction · 0.70
outputGetYAMLFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected