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

Function runNextAllProjects

apps/cli/internal/cli/next.go:147–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

145}
146
147func runNextAllProjects() error {
148 expandNextShortcutFilters()
149
150 allRecs, err := collectAllProjectRecs()
151 if err != nil {
152 return err
153 }
154
155 // Sort by score descending, re-assign ranks
156 sort.Slice(allRecs, func(i, j int) bool {
157 return allRecs[i].Score > allRecs[j].Score
158 })
159 if nextLimit > 0 && nextLimit < len(allRecs) {
160 allRecs = allRecs[:nextLimit]
161 }
162 for i := range allRecs {
163 allRecs[i].Rank = i + 1
164 }
165
166 switch nextFormat {
167 case "json":
168 return WriteJSON(os.Stdout, allRecs)
169 case "yaml":
170 return WriteYAML(os.Stdout, allRecs)
171 case "table":
172 return outputNextAllProjectsTable(allRecs)
173 default:
174 return ValidateFormat(nextFormat, []string{"table", "json", "yaml"})
175 }
176}
177
178// collectAllProjectRecs gathers recommendations from every registered project.
179func collectAllProjectRecs() ([]ProjectRecommendation, error) {

Callers 1

runNextFunction · 0.85

Calls 6

collectAllProjectRecsFunction · 0.85
WriteJSONFunction · 0.85
WriteYAMLFunction · 0.85
ValidateFormatFunction · 0.85

Tested by

no test coverage detected