diff options
author | Julio Capote <jcapote@gmail.com> | 2022-09-08 01:59:13 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2022-09-08 01:59:13 +0000 |
commit | e5eba08f3d2ad61e2452a02eb4f80f94297e3f68 (patch) | |
tree | 3873d0f780eec35a3a489c26644b268cf90b9a8a | |
parent | fa2a7121e3bded8fe58d96b21d18b9567505f50d (diff) | |
download | recit-e5eba08f3d2ad61e2452a02eb4f80f94297e3f68.tar.gz |
wip
Diffstat (limited to '')
-rwxr-xr-x | libexec/recit-todo | 48 | ||||
-rw-r--r-- | share/recit/templates/custom_delim.templ | 1 |
2 files changed, 49 insertions, 0 deletions
diff --git a/libexec/recit-todo b/libexec/recit-todo new file mode 100755 index 0000000..35f3005 --- /dev/null +++ b/libexec/recit-todo @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# Usage: recit todo [-p project-name] +# Summary: Display TODO entries, optionally for one project +set -e + +project="" +query_time="" + +recfile=$(recit-file) + +while getopts "p:" options; do + + case "${options}" in + p) + project=${OPTARG} + ;; + :) + echo "Error: -${OPTARG} requires an argument." + exit 1 + ;; + *) + exit 1 + ;; + esac +done + +expression="" + +if ! [[ "$project" = "" ]]; then + if recsel -t Project -p Id ${recfile} | grep "$project" > /dev/null; then + expression="ProjectRef = '$project'" + else + echo "$project not found, list of available projects:" + recit-recsel-projects + exit 1 + fi +fi + + +recit-recsel-entries "$expression" | grep '[0-9][0-9][0-9][0-9]-[0-9][0-9]\|TODO' + +# recfile=$(recit-file) +# if [[ "$expression" = "" ]]; then +# out=$(recsel -t Entry "$recfile" | recfmt -f "$_RECIT_ROOT/share/recit/templates/custom_delim.templ") +# else +# out=$(recsel -t Entry "$recfile" -e "$expression" | recfmt -f "$_RECIT_ROOT/share/recit/templates/custom_delim.templ") +# fi +# echo -e "$out" diff --git a/share/recit/templates/custom_delim.templ b/share/recit/templates/custom_delim.templ new file mode 100644 index 0000000..876bd0c --- /dev/null +++ b/share/recit/templates/custom_delim.templ @@ -0,0 +1 @@ +:@/{{Id}}:@/{{Time}}:@/{{Notes}} |