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

[patch] _man: Support directories with suffixes



896f43c broke completion for man 3p <tab> on OpenBSD because those man
pages are in /usr/share/man/man3p.

I couldn't figure out what was the purpose for using $~sect, so I just
dropped the tilde.



diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index 0534db7..9aec833 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -52,7 +52,7 @@ _man() {
   fi
 
   if [[ $sect = (<->*|1M|l|n) || $sect = \(*\|*\) ]]; then
-    dirs=( $^_manpath/(sman|man|cat)${~sect%%[^0-9]#}/ )
+    dirs=( $^_manpath/(sman|man|cat)($sect|${sect%%[^0-9]#})/ )
     awk="\$2 == \"$sect\" {print \$1}"
   else
     dirs=( $^_manpath/(sman|man|cat)*/ )



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