diff --git a/cmd/pttodo-cli/cli.go b/cmd/pttodo-cli/cli.go index 557e886..df198f4 100644 --- a/cmd/pttodo-cli/cli.go +++ b/cmd/pttodo-cli/cli.go @@ -38,7 +38,7 @@ func _main() error { filepath := flag.String("f", defaultFilepath, "($PTTODO_FILE) path to yaml file") filepathToMergeIn := flag.String("g", "", "path to yaml file to merge into -f") root := flag.String("root", DUMP_TODO, "path to pretty print ("+fmt.Sprint([]string{DUMP_ALL, DUMP_TODO, DUMP_SCHEDULED, DUMP_DONE})+")") - tags := flag.String("tags", "", "csv of all tags to find") + tags := flag.String("tags", "", "csv of all tags to find, -tag to invert") search := flag.String("search", "", "fts case insensitive") e := flag.Bool("e", false, "edit file") dry := flag.Bool("dry", false, "dry run") @@ -257,7 +257,10 @@ func dump(dry bool, writer io.Writer, filepath string, tags []string, search, ro for _, todo := range todos { want := len(todo.Tags) > 0 for _, tag := range tags { - want = want && strings.Contains(todo.Tags, tag) + positiveTag := strings.TrimLeft(tag, "-") + hasTag := strings.Contains(todo.Tags, positiveTag) + wantToHaveTag := !strings.HasPrefix(tag, "-") + want = want && (hasTag == wantToHaveTag) } if want { result = append(result, todo) diff --git a/todo.yaml b/todo.yaml index 99c602a..70d3d61 100644 --- a/todo.yaml +++ b/todo.yaml @@ -1,4 +1,6 @@ todo: +- when merging, check for complete/incomplete and cross reference todo vs scheduled + vs done - how to defer a scheduled task? - merge multi todo files for 'inbox' style with some dedupe (probably best to just do this via calling pttodo-cli from script or somethin) (probably at an off hour @@ -7,7 +9,6 @@ todo: - what do about todo-now vs todo vs watch vs later... could do many files and manage outside binary, but search would suck. Good would be vendor lockin, and that's UI problem -- add tag anti-search, like -tag=-notMe - todo: when to run scheduled modifier? like, syncthing could have conflicts if I modify only file on remote details: | @@ -26,6 +27,8 @@ todo: - xactions emails extend ledger,todo-server with pttodo - schedule merge inbox style scheduled: [] done: +- todo: add tag anti-search, like -tag=-notMe + ts: Tue Jan 4 06:56:03 EST 2022 - todo: if in todo, then omit ts field ts: Sun Jan 2 20:44:27 EST 2022 - todo: merge full files to import from todo-server