summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-02-03 21:40:25 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-02-03 21:40:25 +0100
commit6a7ebe551040f03b43e0c77a46a9e276e13461e3 (patch)
tree04017c58589b1fa70164df4a7e3bfc890b5fc143
parentb7e83601478249c82a745867e148b12a12561fc7 (diff)
gtd-all: Remove @online GTD entries when offline
-rwxr-xr-xetc/functions/gtd-all17
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
}