lib/utilities: lint `_bash-it-component-help`

pull/1933/head
John D Pell 2021-09-17 23:17:29 -07:00
parent 0a3a019047
commit b3fd8aada8
1 changed files with 6 additions and 4 deletions

View File

@ -72,12 +72,14 @@ function _bash-it-grep()
# completion). # completion).
########################################################################### ###########################################################################
_bash-it-component-help() { function _bash-it-component-help()
local component="$(_bash-it-pluralize-component "${1}")" {
local file="$(_bash-it-component-cache-file "${component}")" local component file func
component="$(_bash-it-pluralize-component "${1}")"
file="$(_bash-it-component-cache-file "${component}")"
if [[ ! -s "${file}" || -z "$(find "${file}" -mmin -300)" ]] ; then if [[ ! -s "${file}" || -z "$(find "${file}" -mmin -300)" ]] ; then
rm -f "${file}" 2>/dev/null rm -f "${file}" 2>/dev/null
local func="_bash-it-${component}" func="_bash-it-${component}"
"${func}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E ' \[' > "${file}" "${func}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E ' \[' > "${file}"
fi fi
cat "${file}" cat "${file}"