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

Function injectProjectColumn

apps/cli/internal/cli/all_projects.go:50–65  ·  view source on GitHub ↗

injectProjectColumn adds a "project" column after the first column if not already present.

(columns []string)

Source from the content-addressed store, hash-verified

48
49// injectProjectColumn adds a "project" column after the first column if not already present.
50func injectProjectColumn(columns []string) []string {
51 for _, col := range columns {
52 if col == "project" {
53 return columns
54 }
55 }
56 insertIdx := 1
57 if len(columns) < 2 {
58 insertIdx = len(columns)
59 }
60 result := make([]string, 0, len(columns)+1)
61 result = append(result, columns[:insertIdx]...)
62 result = append(result, "project")
63 result = append(result, columns[insertIdx:]...)
64 return result
65}
66
67// scanProjectTasks scans a single project and returns its tasks with relative file paths.
68func scanProjectTasks(entry GlobalProjectEntry) ([]*model.Task, error) {

Callers 2

outputProjectTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected