summaryrefslogtreecommitdiff
path: root/etc/functions/gtd-all
blob: cefe62b2308e9d0370b59ce52b6886f0058eaa3b (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
typeset prefix=~/var/gtd
typeset database
typeset arg=$1

function gtd_grep {
	if [[ $arg == force ]] {
		cat
		return 0
	}
	if [[ -r ~/var/tmp/.actual-location && $(<~/var/tmp/.actual-location) == offline ]] {
		fgrep -v '@online'
		return 0
	}
	cat
	return 0
}

for database in $prefix/*(.N); {
	echo "\n${database:t}"
	todo --database $database --force-colour | gtd_grep
}