From 6a7ebe551040f03b43e0c77a46a9e276e13461e3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 3 Feb 2009 21:40:25 +0100 Subject: gtd-all: Remove @online GTD entries when offline --- etc/functions/gtd-all | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'etc/functions') 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 } -- cgit v1.2.3