Skip to content

Commit

Permalink
man: Fix completion when failglob option is enabled (#225)
Browse files Browse the repository at this point in the history
Modified-by: Ville Skyttä <ville.skytta@iki.fi>
  • Loading branch information
russelldavis authored and scop committed Jan 12, 2019
1 parent 2aa57d1 commit b3a25cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions completions/man
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ _man()
manpath="${manpath//://*man$sect/ } ${manpath//://*cat$sect/ }"
fi

local IFS=$' \t\n' reset=$( shopt -p failglob ); shopt -u failglob
# redirect stderr for when path doesn't exist
COMPREPLY=( $( eval command ls "$manpath" 2>/dev/null ) )
$reset

# weed out directory path names and paths to man pages
COMPREPLY=( ${COMPREPLY[@]##*/?(:)} )
# strip suffix from man pages
Expand Down

0 comments on commit b3a25cf

Please sign in to comment.