Allow disabling alias check
This commit is contained in:
@@ -99,7 +99,20 @@ preexec() {
|
|||||||
echo -ne '\e[5 q'
|
echo -ne '\e[5 q'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function disable_alias_check() {
|
||||||
|
export DISABLE_ALIAS_CHECK=1
|
||||||
|
echo "Alias check disabled."
|
||||||
|
}
|
||||||
|
|
||||||
|
function enable-alias-check() {
|
||||||
|
unset DISABLE_ALIAS_CHECK
|
||||||
|
echo "Alias check enabled."
|
||||||
|
}
|
||||||
|
|
||||||
function alias_suggestion_check() {
|
function alias_suggestion_check() {
|
||||||
|
if [[ $DISABLE_ALIAS_CHECK = 1 ]] {
|
||||||
|
return
|
||||||
|
}
|
||||||
local current_cmd="$1"
|
local current_cmd="$1"
|
||||||
|
|
||||||
if [[ -z "$current_cmd" || ${#current_cmd} -lt 7 ]]; then
|
if [[ -z "$current_cmd" || ${#current_cmd} -lt 7 ]]; then
|
||||||
@@ -114,6 +127,9 @@ function alias_suggestion_check() {
|
|||||||
preexec_functions+=(alias_suggestion_check)
|
preexec_functions+=(alias_suggestion_check)
|
||||||
|
|
||||||
function remind_alias_if_exists() {
|
function remind_alias_if_exists() {
|
||||||
|
if [[ $DISABLE_ALIAS_CHECK = 1 ]] {
|
||||||
|
return
|
||||||
|
}
|
||||||
local current_cmd="$1"
|
local current_cmd="$1"
|
||||||
|
|
||||||
if [[ -z "$current_cmd" || ${#current_cmd} -lt 7 ]]; then
|
if [[ -z "$current_cmd" || ${#current_cmd} -lt 7 ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user