Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _alternative: Fix (...) action syntax
- X-seq: zsh-workers 43928
- From: dana <dana@xxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: [PATCH] _alternative: Fix (...) action syntax
- Date: Sat, 22 Dec 2018 02:07:24 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=X0GV3xapP994O52u4PfQMEqzDqufO/6irLvFRUWpLTI=; b=L6ogbm2v3U3c68Zhmq/cgUElHqic5mna0/riTpLeiPcrPmGuuPrK0Qe4uFq8vYFNQ8 LsM/9z827QgiV/ikUez6sPaS5hnvFj5DVebtFf7j9zbdnSDh/Z7sB0hHk4s6NNrWWW1p JPO418PpPgQHt6gUmscYSqGlo0qsEQ5mOCERGDst1cIxY8SinPGedLMjt2ggZesWX4Dw d6QIEy6AmMUOkk9BeF9FaknS9ZveXkroSepHKD9VM9qtBCxIIEZbBbRyfRC3EASkrZSt UZhR55JXb3fMiYzyfUE7FndGEQpvmZuw7erRJ2t9eV+AIcPk8PlEaa6z5ZuCKiIOarXU 87oA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
A long time ago Oliver found that _alternative didn't handle the ((...\:...))
action syntax properly, and that was fixed in workers/18347. But it also
didn't handle (...) properly, and i think the same kind of fix is probably
warranted (just copy/paste from _arguments basically). So here's that
PS: Sorry for bug/patch spam, lots of unstructured holiday free time here
dana
diff --git a/Completion/Base/Utility/_alternative b/Completion/Base/Utility/_alternative
index bfb34a604..3c61d1125 100644
--- a/Completion/Base/Utility/_alternative
+++ b/Completion/Base/Utility/_alternative
@@ -43,8 +43,10 @@ while _tags; do
# Anything inside `(...)' is added directly.
+ eval ws\=\( "${action[2,-2]}" \)
+
_all_labels "${def%%:*}" expl "$descr" \
- compadd "$subopts[@]" - ${=action[2,-2]}
+ compadd "$subopts[@]" -a - ws
elif [[ "$action" = \{*\} ]]; then
# A string in braces is evaluated.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author