1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-23 04:30:24 +02:00

Silas Silva: completion support for man -M

This commit is contained in:
Peter Stephenson 2010-10-21 19:15:29 +00:00
parent 76351e9b69
commit f2081c6bc3
2 changed files with 16 additions and 1 deletions

View file

@ -3,6 +3,10 @@
_man() {
local dirs expl mrd awk
if (( $words[(I)-M] == (( $CURRENT - 1 )) )); then
_directories && return 0
fi
if [[ $service == man ]] && (( $words[(I)-l] + $words[(I)--local-file] )); then
_files || return 0
fi
@ -21,6 +25,12 @@ _man() {
(( $#_manpath )) ||
_manpath=( /usr/man(-/) /(opt|usr)/(pkg|dt|share|X11R6|local)/(cat|)man(-/) )
if (( $words[(I)-M] )); then
local opt
opt=$words[(( $words[(I)-M]+1 ))]
_manpath=($_manpath $opt)
fi
# `sman' is the SGML manual directory for Solaris 7.
# 1M is system administrator commands on SVR4