Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 4/4] _postfix: Support $enable_long_queue_ids.
- X-seq: zsh-workers 39108
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 4/4] _postfix: Support $enable_long_queue_ids.
- Date: Sat, 27 Aug 2016 18:44:50 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:in-reply-to:message-id :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=2V9Zz 5FRJTkOJbAt89QjfnRsFWI=; b=rXY8welB/HqMQzcNM+4W55qoGDoX2nWB1LKpi l/jikZf1S0yqXKrsfLXmVjYzvWfGKu6TkBKDcbqlAz9pT+J9HUkyjJp/73JiDT5k yw2GEO73xcGaKW+dw3LpwNBlMVZz3DReniGqEfn8tVTOSqqNZwZN+Q4Cjr9kPa1K 0fWJSw=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:in-reply-to:message-id :references:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=2V9Z z5FRJTkOJbAt89QjfnRsFWI=; b=rEQNBMsdeT1YH5m83n5vjypL8Ge3udRcaZtg czzPzlGNG4Rii80xD1D46Naw1GFc3chqbNhoZrgLtmYmF2E1bj9VQA5C8JDa7S5z ShLJBexPHAcO8ijUGnc8r2svgUa8D2Vn7Ct3DFYdxKerr5Jv+t9NM8XPP4rHLNrZ LOXkUtE=
- In-reply-to: <1472323490-30345-1-git-send-email-danielsh@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1472323490-30345-1-git-send-email-danielsh@fujitsu.shahaf.local2>
Note that this not only adds a second compadd invocation but also adds a space
to the first compadd invocation, to prevent the start of a new-style queue id
from matching as an old-style queue id.
---
Completion/Unix/Command/_postfix | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Completion/Unix/Command/_postfix b/Completion/Unix/Command/_postfix
index 8880dbf..e610a1d 100644
--- a/Completion/Unix/Command/_postfix
+++ b/Completion/Unix/Command/_postfix
@@ -7,7 +7,13 @@ typeset -A opt_args
integer NORMARG
_postfix_queue_id() {
- compadd "$@" -- ${${(M)${(f)"$(_call_program mailq 'mailq')"}:#(#s)([0-9A-F]##)*}/(#s)(#b)([0-9A-F]##)*/$match[1]}
+ local -a lines=( ${(f)"$(_call_program mailq 'mailq')"} )
+
+ # $enable_long_queue_ids = no
+ compadd "$@" -- ${${(M)lines:#(#s)([0-9A-F]## )*}/(#s)(#b)([0-9A-F]##)*/$match[1]}
+
+ # $enable_long_queue_ids = yes
+ compadd "$@" -- ${${(M)lines:#(#s)[0-9bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ](#c10)z*}%% *}
}
_postfix_main_cf_parameter() {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author