summaryrefslogtreecommitdiff
path: root/etc/functions/finfo
blob: 62a5fe9a1d1532e94a18301a8329567f6d5439fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
## vim:ft=zsh
## finfo - show function info
## Assume that a function begins with an introduction, and print it
## Usage: finfo <function name>
typeset line

whichf $1 &> /dev/null || return 1

while read line; do
	[[ $line == \#* ]] || break
	[[ $line == *vim:ft=* ]] && continue
	[[ $line == \#(autoload|compdef)* ]] && continue
	echo ${line#(\#|)\# }
done < $(whichf $1)