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

PATCH: man -l (local-file) completion



This is a quick hack to have files completed for 'man -l' rather than
manpages.  This is good for the man-db used by Debian.  The only other
man I can think of that uses -l is Solaris, and though it has a different
meaning, I don't think completing manpages nor filenames is particularly
useful there, so this shouldn't really hurt.

This should naturally be subsumed by more comprehensive options handling.

Index: Completion/User/_man
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_man,v
retrieving revision 1.5
diff -u -r1.5 _man
--- Completion/User/_man	2000/07/19 09:03:30	1.5
+++ Completion/User/_man	2000/09/03 21:37:42
@@ -4,6 +4,10 @@
 
 local rep expl star approx mrd
 
+if [[ $words[1] == man ]] && (( $words[(I)-l] + $words[(I)--local-file] )); then
+  _files || return 0
+fi
+
 if [[ $compstate[pattern_match] != [^*] ]]; then
   # If a string other than *, we just want correction, so no `*'.
   star='*'



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