zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] devtodo completion: respect --sort option
@ 2013-04-16  6:47 Daniel Friesel
  0 siblings, 0 replies; only message in thread
From: Daniel Friesel @ 2013-04-16  6:47 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 85 bytes --]

Hi,

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

--Daniel

[-- Attachment #1.2: 0001-devtodo-completion-respect-sort-option.patch --]
[-- Type: text/x-diff, Size: 1057 bytes --]

From b05fa9317e6041978605c54c92a50fea749033fa Mon Sep 17 00:00:00 2001
From: Daniel Friesel <derf@finalrewind.org>
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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-16  6:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-16  6:47 [PATCH] devtodo completion: respect --sort option Daniel Friesel

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).