diff options
Diffstat (limited to 'completions/man')
-rw-r--r-- | completions/man | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/completions/man b/completions/man index a9de57c4..0c3769d5 100644 --- a/completions/man +++ b/completions/man @@ -8,10 +8,10 @@ _man() local cur prev words cword split _init_completion -s -n : || return - local i sect manpath manext mansect uname + local sect manpath manext mansect - manext="@([0-9lnp]|[0-9][px]|man|3pm)?(.@([gx]z|bz2|lzma|Z))" - mansect="@([0-9lnp]|[0-9][px]|3pm)" + manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?(.@([gx]z|bz2|lzma|Z))" + mansect="@([0-9lnp]|[0-9][px]|3?(gl|pm))" case $prev in -C|--config-file) @@ -56,8 +56,7 @@ _man() return 0 fi - uname=$( uname -s ) - if [[ $uname == @(Linux|GNU|GNU/*|FreeBSD|Cygwin|CYGWIN_*) ]]; then + if [[ $OSTYPE == *@(darwin|linux|freebsd|cygwin)* ]] || _userland GNU; then manpath=$( manpath 2>/dev/null || command man --path ) else manpath=$MANPATH @@ -89,7 +88,7 @@ _man() if [[ "$prev" != $mansect ]]; then # File based completion for the rest, prepending ./ if needed # (man 1.6f needs that for man pages in current dir) - local start=${#COMPREPLY[@]} + local i start=${#COMPREPLY[@]} _filedir $manext for (( i=$start; i < ${#COMPREPLY[@]}; i++ )); do [[ ${COMPREPLY[i]} == */* ]] || COMPREPLY[i]=./${COMPREPLY[i]} |