lib/utilities: fix `_bash-it-component-help()` for long component names
Alsö, minor tweak to `_bash-it-array-contains-element()` for clarity. This fixes Bash-It/bash-it#1978.pull/1999/head
parent
e3bd30f98d
commit
c3eaa606de
|
|
@ -47,9 +47,10 @@ function _bash-it-get-component-type-from-path() {
|
|||
#
|
||||
#
|
||||
function _bash-it-array-contains-element() {
|
||||
local e
|
||||
for e in "${@:2}"; do
|
||||
[[ "$e" == "$1" ]] && return 0
|
||||
local e element="${1?}"
|
||||
shift
|
||||
for e in "$@"; do
|
||||
[[ "$e" == "${element}" ]] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
|
@ -82,7 +83,7 @@ function _bash-it-component-help() {
|
|||
file="$(_bash-it-component-cache-file "${component}")"
|
||||
if [[ ! -s "${file}" || -z "$(find "${file}" -mmin -300)" ]]; then
|
||||
func="_bash-it-${component}"
|
||||
"${func}" | _bash-it-egrep ' \[' >| "${file}"
|
||||
"${func}" | _bash-it-egrep '\[[x ]\]' >| "${file}"
|
||||
fi
|
||||
cat "${file}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue