diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-02-03 21:40:25 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-02-03 21:40:25 +0100 |
commit | 6a7ebe551040f03b43e0c77a46a9e276e13461e3 (patch) | |
tree | 04017c58589b1fa70164df4a7e3bfc890b5fc143 /etc/functions/gtd-all | |
parent | b7e83601478249c82a745867e148b12a12561fc7 (diff) |
gtd-all: Remove @online GTD entries when offline
Diffstat (limited to 'etc/functions/gtd-all')
-rwxr-xr-x | etc/functions/gtd-all | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/etc/functions/gtd-all b/etc/functions/gtd-all index f1a46c6..cefe62b 100755 --- a/etc/functions/gtd-all +++ b/etc/functions/gtd-all @@ -1,7 +1,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 + todo --database $database --force-colour | gtd_grep } |