summaryrefslogtreecommitdiff
path: root/etc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'etc/functions')
-rw-r--r--etc/functions/gtd-move18
1 files changed, 18 insertions, 0 deletions
diff --git a/etc/functions/gtd-move b/etc/functions/gtd-move
new file mode 100644
index 0000000..c9eee09
--- /dev/null
+++ b/etc/functions/gtd-move
@@ -0,0 +1,18 @@
+## vim:ft=zsh
+
+if [[ ${#*} != 3 ]] {
+ echo "Usage: gtd-move <from-database> <item> <to-database>"
+ return
+}
+
+typeset prefix="$HOME/var/gtd"
+typeset format='display=%T\n%p'
+typeset from=$1
+typeset itemno=$2
+typeset to=$3
+typeset IFS=$'\n'
+typeset -a item
+
+item=($(todo --database $prefix/$from --format $format $itemno))
+todo --database $prefix/$to --priority $item[2] --add $item[1]
+todo --database $prefix/$from --remove $itemno