Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Possible bug with man -M /some/path completion



On Tue, 27 May 2014 19:33:13 -0400
"Keerthan jai.c" <jckeerthan@xxxxxxxxx> wrote:
> According to man man, the -M option overrides manpath rather than appending
> to it.
> However, zsh completion shows entries outside the path specified with -M.
> 
> I think this is the relevant code:
> 
>   integer index=$words[(I)-M]
>   if (( index )); then
>     local opt
>     opt=$words[index+1]
>     _manpath=($_manpath $opt)
>   fi
> 
> I think _manpath should become just $opt

That looks reasonable, thanks.

diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index d1346f7..81ac40b 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -29,7 +29,7 @@ _man() {
   if (( index )); then
     local opt
     opt=$words[index+1]
-    _manpath=($_manpath $opt)
+    _manpath=($opt)
   fi
 
   # `sman' is the SGML manual directory for Solaris 7.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author