mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 13:01:28 +02:00
Silas Silva: completion support for man -M
This commit is contained in:
parent
76351e9b69
commit
f2081c6bc3
2 changed files with 16 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2010-10-21 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* Silas Silva: users/15464: Completion/Unix/Command/_man:
|
||||
support for -M argument.
|
||||
|
||||
2010-10-18 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* Jérôme Pouiller: 28351: Functions/Misc/run-help-openssl,
|
||||
|
@ -13768,5 +13773,5 @@
|
|||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.5109 $
|
||||
* $Revision: 1.5110 $
|
||||
*****************************************************
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue