17 lines
355 B
Bash
17 lines
355 B
Bash
# Get help about bash function.
|
|
function help() {
|
|
local fun="${1}"
|
|
|
|
if [[ $(find_functions | grep "${fun}") = "" ]]; then
|
|
echo "Function not found."
|
|
return 1
|
|
fi
|
|
|
|
sed -e '$s/$/\n/' -s "${DOTFILES_PATH}"/* | sed -n -e "/function ${fun}()/q;p" | tac | sed -n -e "/^$/q;p" | tac | sed -e "s/^# \+//"
|
|
}
|
|
|
|
# Short for help.
|
|
function h() {
|
|
help "${@}"
|
|
}
|