summaryrefslogtreecommitdiff
path: root/etc/functions/gtd-move
blob: 3407f4ed760eb058700147b12eaeb6b0db8c1f5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## vim:ft=zsh
## Helper for my gtd system
## Usage: gtd-move <old-database> <index> <new-database>
## Copyright (C) 2008 by Daniel Friesel <derf@derf.homelinux.org>
## License: WTFPL <http://sam.zoy.org/wtfpl>

if [[ ${#*} != 3 ]] {
	echo "Usage: gtd-move <from-database> <item> <to-database>"
	return
}

typeset prefix="${HOME}/var/gtd"
typeset format='display=%T'
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 medium --add ${item}
todo --database ${prefix}/${from} --remove ${itemno}