about summary refs log tree commit diff
path: root/Completion/Unix/Command/_postfix
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-08-27 18:44:50 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-08-30 01:58:59 +0000
commit4ce0b1c0985f469ac93341185f06dd8bdb2c91d0 (patch)
tree5718746c096917a6f642a987d50b513993293851 /Completion/Unix/Command/_postfix
parentd916ba1a00a809187219e571b94ddd299a39003f (diff)
downloadzsh-4ce0b1c0985f469ac93341185f06dd8bdb2c91d0.tar.gz
zsh-4ce0b1c0985f469ac93341185f06dd8bdb2c91d0.tar.xz
zsh-4ce0b1c0985f469ac93341185f06dd8bdb2c91d0.zip
39108 (tweaked): _postfix: Support $enable_long_queue_ids.
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.
Diffstat (limited to 'Completion/Unix/Command/_postfix')
-rw-r--r--Completion/Unix/Command/_postfix8
1 files changed, 7 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_postfix b/Completion/Unix/Command/_postfix
index 8880dbf90..ab9518212 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() {