summaryrefslogtreecommitdiff
path: root/etc/functions/gtd-all
blob: c4e23e6d32ba650552e4ca961e37aafceceb831c (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 | gtd_grep
}