Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 1/3] _man: Drop (b): it's incorrect when $sect contains '|'.
- X-seq: zsh-workers 38993
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 1/3] _man: Drop (b): it's incorrect when $sect contains '|'.
- Date: Thu, 4 Aug 2016 15:54:23 +0000
- In-reply-to: <1470326066-3241-1-git-send-email-danielsh@tarsus.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: <1470326066-3241-1-git-send-email-danielsh@tarsus.local2>
---
Completion/Unix/Command/_man | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index e892bb2..ef17ad8 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -37,7 +37,10 @@ _man() {
mrd=(${^_manpath/\%L/${LANG:-En_US.ASCII}}/mandb(N))
- # $sect is from the command line, the "3p" in "man 3p memcpy"
+ # $sect is from the command line, the "3p" in "man 3p memcpy".
+ # It may also be a |-joined (and later in the code "()"-enclosed) list of
+ # section names.
+ # TODO: disentangle this to always be an array.
# $sect_dirname is from the filesystem, the "3" in "/usr/share/man/man3"
# These are used by _man_pages
local sect sect_dirname
@@ -117,7 +120,7 @@ _man_pages() {
fi
pages=( ${(M)dirs:#*$sect_dirname/} )
- compfiles -p pages '' '' "$matcher" '' dummy "*${(b)sect}*"
+ compfiles -p pages '' '' "$matcher" '' dummy "*${sect}*"
pages=( ${^~pages}(N:t) )
(($#mrd)) && pages[$#pages+1]=($(awk $awk $mrd))
Messages sorted by:
Reverse Date,
Date,
Thread,
Author