summaryrefslogtreecommitdiff
path: root/etc/functions/help
blob: 1b338b2b87b476994ad2dc10eeb5f756cd91b49a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
## vim:ft=zsh
## wrapper around man, finfo, etc

if man -w $1 &> /dev/null; then
	man $1
elif whichf $1 &> /dev/null; then
	finfo $1
elif (( ${+builtins[$1]} )); then
	man zshbuiltins | less -p "       $1"
elif [[ $commands[$1] != ${HOME}* ]] && check_com -c $1 && check_com -c apt-file; then
	apt-cache show ${(s/:/)$(apt-file search -F $commands[$1])[1]}
else
	echo "Sorry, no clue." >&2
	return 1
fi