Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] devtodo completion: respect --sort option



Hi,

this patch makes _devtodo behave correctly when using devtodo --sort.

--Daniel
From b05fa9317e6041978605c54c92a50fea749033fa Mon Sep 17 00:00:00 2001
From: Daniel Friesel <derf@xxxxxxxxxxxxxxx>
Date: Tue, 16 Apr 2013 08:39:17 +0200
Subject: [PATCH] devtodo completion: respect --sort option

The --sort option changes the mapping between indices and entries, so when
completing indices while showing the entries as help we need to respect it.
---
 Completion/Unix/Command/_devtodo |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Completion/Unix/Command/_devtodo b/Completion/Unix/Command/_devtodo
index 06fc675..2800f4a 100644
--- a/Completion/Unix/Command/_devtodo
+++ b/Completion/Unix/Command/_devtodo
@@ -8,9 +8,11 @@ typeset -i i
 typeset expl
 
 for ((i=2; i <= $#words; i++)) {
-	if [[ $words[$i] == '--database' ]] {
+	if [[ $words[$i] == '--database' ]]; then
 		todo_opts+=(--database ${~words[$((++i))]})
-	}
+	elif [[ $words[$i] == '--sort' ]]; then
+		todo_opts+=(--sort ${words[$((++i))]})
+	fi
 }
 
 priorities=(verylow low medium high veryhigh)
-- 
1.7.10.4

Attachment: signature.asc
Description: Digital signature



Messages sorted by: Reverse Date, Date, Thread, Author