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

Function findExactMatch

apps/cli/internal/cli/get.go:189–202  ·  view source on GitHub ↗

findExactMatch tries ID match (case-sensitive), then title match (case-insensitive).

(query string, tasks []*model.Task)

Source from the content-addressed store, hash-verified

187
188// findExactMatch tries ID match (case-sensitive), then title match (case-insensitive).
189func findExactMatch(query string, tasks []*model.Task) *model.Task {
190 for _, t := range tasks {
191 if t.ID == query {
192 return t
193 }
194 }
195 lowerQuery := strings.ToLower(query)
196 for _, t := range tasks {
197 if strings.ToLower(t.Title) == lowerQuery {
198 return t
199 }
200 }
201 return nil
202}
203
204// findFilePathMatch tries to match the query against task file paths and filenames.
205func findFilePathMatch(query string, tasks []*model.Task) (*model.Task, error) {

Callers 7

TestFindExactMatchFunction · 0.85
runSetFunction · 0.85
runCommitMsgFunction · 0.85
runVerifyFunction · 0.85
runRmFunction · 0.85
runContextFunction · 0.85
resolveTaskFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFindExactMatchFunction · 0.68