Skip to content

Instantly share code, notes, and snippets.

@scop
Created April 14, 2016 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scop/69f72ea2720ae2d54f278b102907faa1 to your computer and use it in GitHub Desktop.
Save scop/69f72ea2720ae2d54f278b102907faa1 to your computer and use it in GitHub Desktop.
diff --git a/completions/man b/completions/man
index e1b587d..628e43c 100644
--- a/completions/man
+++ b/completions/man
@@ -56,17 +56,10 @@ _man()
return 0
fi
- local manpath
- if [[ $OSTYPE == *@(darwin|linux|freebsd|cygwin)* ]] || _userland GNU; then
- manpath=$( manpath 2>/dev/null || command man -w )
- else
- manpath=$MANPATH
- fi
-
- if [[ -z $manpath ]]; then
- COMPREPLY=( $( compgen -c -- "$cur" ) )
- return 0
- fi
+ local manpath="$MANPATH"
+ [[ -z $manpath ]] && \
+ manpath=$( manpath 2>/dev/null || command man -w 2>/dev/null )
+ [[ -z $manpath ]] && manpath="/usr/share/man:/usr/local/share/man"
# determine manual section to search
local sect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment