summaryrefslogtreecommitdiff
path: root/etc/functions
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-10-30 17:29:50 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2008-10-30 17:29:50 +0100
commitb120bebbbe8e72904513f9b8caea39141809d42c (patch)
tree82a0cd59f64ce8aa643821ab246fb9ef97e428c9 /etc/functions
parent3727fca950b95eafdeaceca79cef387a8f6fc446 (diff)
Added gtd-move function
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