dotfiles/home/private_dot_config/zsh/functions/fnhelp

14 lines
355 B
Text
Raw Normal View History

2023-02-17 09:26:31 -06:00
##? fnhelp - use '##?' comments in function files as help docs.
##?
##? usage: fnhelp <func>
# function fnhelp {
local ZFUNCDIR="${ZFUNCDIR:-${ZDOTDIR:-~/.config/zsh}/functions}"
if [[ ! -f "$ZFUNCDIR/$1" ]]; then
echo >&2 "fnhelp: function not found '$1'." && return 1
fi
command grep "^##?" "$ZFUNCDIR/$1" | cut -c 5-
# }
# vim: ft=zsh sw=2 ts=2 et