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

Re: PATCH: 3.1.6-pws-3: _man



This is another patch for _man to handle gzipped and/or SGML manual.

Index: Completion/User/_man
===================================================================
RCS file: /projects/zsh/zsh/Completion/User/_man,v
retrieving revision 1.1.1.6
diff -u -F^( -r1.1.1.6 _man
--- _man	1999/09/09 09:47:08	1.1.1.6
+++ _man	1999/09/09 11:19:28
@@ -1,6 +1,6 @@
 #compdef man
 
-setopt localoptions rcexpandparam
+setopt localoptions rcexpandparam extendedglob
 
 local rep expl star approx
 
@@ -14,12 +14,14 @@
   approx="(#a${_comp_correct})"
 fi
 
+# `sman' is the SGML manual directory for Solaris 7.
+
 if [[ $words[2] = (<->*|ln) ]]; then
   rep=(
-  $manpath/(man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t:r) )
+  $manpath/(sman|man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t) )
 else
-  rep=( $manpath/(man|cat)*/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t:r) )
+  rep=( $manpath/(sman|man|cat)*/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t) )
 fi
 
 _description expl 'manual page'
-(( $#rep )) && compadd "$expl[@]" - $rep
+(( $#rep )) && compadd "$expl[@]" - ${rep%%.[^.]##(.gz|)}
-- 
Tanaka Akira



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