commit
c90a6283ef
|
|
@ -711,8 +711,8 @@ _enable-thing ()
|
|||
|
||||
# Load the priority from the file if it present there
|
||||
declare local_file_priority use_load_priority
|
||||
local_file_priority=$(grep -E "^# BASH_IT_LOAD_PRIORITY:" "${BASH_IT}/$subdirectory/available/$to_enable" | awk -F': ' '{ print $2 }')
|
||||
use_load_priority=${local_file_priority:-$load_priority}
|
||||
local_file_priority="$(_bash-it-egrep "^# BASH_IT_LOAD_PRIORITY:" "${BASH_IT}/$subdirectory/available/$to_enable" | awk -F': ' '{ print $2 }')"
|
||||
use_load_priority="${local_file_priority:-$load_priority}"
|
||||
|
||||
ln -s ../$subdirectory/available/$to_enable "${BASH_IT}/enabled/${use_load_priority}${BASH_IT_LOAD_PRIORITY_SEPARATOR}${to_enable}"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ _bash-it-search() {
|
|||
|
||||
local component
|
||||
export BASH_IT_SEARCH_USE_COLOR=true
|
||||
export BASH_IT_GREP=${BASH_IT_GREP:-$(which egrep)}
|
||||
declare -a BASH_IT_COMPONENTS=(aliases plugins completions)
|
||||
|
||||
if [[ -z "$*" ]] ; then
|
||||
|
|
@ -168,7 +167,7 @@ ${echo_underline_yellow}SUMMARY${echo_normal}
|
|||
_bash-it-is-partial-match() {
|
||||
local component="$1"
|
||||
local term="$2"
|
||||
_bash-it-component-help "${component}" | $(_bash-it-grep) -E -i -q -- "${term}"
|
||||
_bash-it-component-help "${component}" | _bash-it-egrep -i -q -- "${term}"
|
||||
}
|
||||
|
||||
_bash-it-component-term-matches-negation() {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,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_GREP:-$(_bash-it-grep)} -E ' \[' >| "${file}"
|
||||
"${func}" | _bash-it-egrep ' \[' >| "${file}"
|
||||
fi
|
||||
cat "${file}"
|
||||
}
|
||||
|
|
@ -130,17 +130,17 @@ function _bash-it-component-list-matching() {
|
|||
local component="$1"
|
||||
shift
|
||||
local term="$1"
|
||||
_bash-it-component-help "${component}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E -- "${term}" | awk '{print $1}' | sort -u
|
||||
_bash-it-component-help "${component}" | _bash-it-egrep -- "${term}" | awk '{print $1}' | sort -u
|
||||
}
|
||||
|
||||
function _bash-it-component-list-enabled() {
|
||||
local IFS=$'\n' component="$1"
|
||||
_bash-it-component-help "${component}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E '\[x\]' | awk '{print $1}' | sort -u
|
||||
_bash-it-component-help "${component}" | _bash-it-egrep '\[x\]' | awk '{print $1}' | sort -u
|
||||
}
|
||||
|
||||
function _bash-it-component-list-disabled() {
|
||||
local IFS=$'\n' component="$1"
|
||||
_bash-it-component-help "${component}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E -v '\[x\]' | awk '{print $1}' | sort -u
|
||||
_bash-it-component-help "${component}" | _bash-it-egrep -v '\[x\]' | awk '{print $1}' | sort -u
|
||||
}
|
||||
|
||||
# Checks if a given item is enabled for a particular component/file-type.
|
||||
|
|
@ -154,7 +154,7 @@ function _bash-it-component-list-disabled() {
|
|||
function _bash-it-component-item-is-enabled() {
|
||||
local component="$1"
|
||||
local item="$2"
|
||||
_bash-it-component-help "${component}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E '\[x\]' | ${BASH_IT_GREP:-$(_bash-it-grep)} -E -q -- "^${item}\s"
|
||||
_bash-it-component-help "${component}" | _bash-it-egrep '\[x\]' | _bash-it-egrep -q -- "^${item}\s"
|
||||
}
|
||||
|
||||
# Checks if a given item is disabled for a particular component/file-type.
|
||||
|
|
@ -168,5 +168,5 @@ function _bash-it-component-item-is-enabled() {
|
|||
function _bash-it-component-item-is-disabled() {
|
||||
local component="$1"
|
||||
local item="$2"
|
||||
_bash-it-component-help "${component}" | ${BASH_IT_GREP:-$(_bash-it-grep)} -E -v '\[x\]' | ${BASH_IT_GREP:-$(_bash-it-grep)} -E -q -- "^${item}\s"
|
||||
_bash-it-component-help "${component}" | _bash-it-egrep -v '\[x\]' | _bash-it-egrep -q -- "^${item}\s"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue