From: Daniel Friesel <derf@chaosdorf.de>
To: zsh-workers@zsh.org
Subject: [PATCH] devtodo completion: respect --sort option
Date: Tue, 16 Apr 2013 08:47:54 +0200 [thread overview]
Message-ID: <20130416064754.GA24505@derf.homelinux.org> (raw)
[-- 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 --]
reply other threads:[~2013-04-16 6:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130416064754.GA24505@derf.homelinux.org \
--to=derf@chaosdorf.de \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).