From 394a4a82e5dc5b5e0425df29b835f87578de9962 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 24 Mar 2009 22:41:07 +0100 Subject: gtd-all: Pass additional arguments to devtodo --- etc/functions/gtd-all | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'etc/functions/gtd-all') diff --git a/etc/functions/gtd-all b/etc/functions/gtd-all index c4e23e6..ddbfdba 100755 --- a/etc/functions/gtd-all +++ b/etc/functions/gtd-all @@ -1,10 +1,20 @@ ## vim:ft=zsh +## concatenate all GTD databases +## usage: gtd-all [--force] [devtodo options] typeset prefix=~/var/gtd typeset database -typeset arg=$1 +typeset -i force + +while [[ $1 == -* ]] { + case $1 in + -|--) shift; break ;; + --force) force=1 ;; + esac + shift +} function gtd_grep { - if [[ $arg == force ]] { + if (( force )) { cat return 0 } @@ -18,5 +28,5 @@ function gtd_grep { for database in $prefix/*(.N); { echo "\n${database:t}" - todo --database $database | gtd_grep + todo --database $database $* | gtd_grep } -- cgit v1.2.3