Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env python3
# Save as in hooks directory, then:
# $ chmod +x ~/.task/hooks/
# Anything after "annotate:" in a new task's description is added as an
# annotation:
# $ task add this is the description annotate:this is an annotation
import json
import sys
task = json.loads(sys.stdin.readline())
desc, anno = task["description"].split(" annotate:")
task["description"] = desc
task["annotations"] = [{"entry": task["entry"], "description": anno}]
except ValueError:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment