We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f966e62 commit 58889b9Copy full SHA for 58889b9
completions/man
@@ -58,7 +58,17 @@ _man()
58
fi
59
60
local manpath=$(manpath 2>/dev/null || command man -w 2>/dev/null)
61
- [[ -z $manpath ]] && manpath="/usr/share/man:/usr/local/share/man"
+ if [[ -z $manpath ]]; then
62
+ # Note: Both "manpath" and "man -w" may be unavailable, in
63
+ # which case we determine the man paths based on the
64
+ # environment variable MANPATH.
65
+ manpath=:${MANPATH-}:
66
+ # Note: An empty path (represented by two consecutive colons
67
+ # or a preceding/trailing colon) represents the system man
68
+ # paths.
69
+ manpath=${manpath//::/':/usr/share/man:/usr/local/share/man:'}
70
+ manpath=${manpath:1:-1}
71
+ fi
72
73
# determine manual section to search
74
local sect
0 commit comments