Double quote some variables
parent
9c4f7773b9
commit
4d821338a3
|
|
@ -3,7 +3,7 @@
|
||||||
_bash-it-comp-enable-disable()
|
_bash-it-comp-enable-disable()
|
||||||
{
|
{
|
||||||
local enable_disable_args="alias completion plugin"
|
local enable_disable_args="alias completion plugin"
|
||||||
COMPREPLY=( $(compgen -W "${enable_disable_args}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${enable_disable_args}" -- "${cur}") )
|
||||||
}
|
}
|
||||||
|
|
||||||
_bash-it-comp-list-available-not-enabled()
|
_bash-it-comp-list-available-not-enabled()
|
||||||
|
|
@ -16,7 +16,7 @@ _bash-it-comp-list-available-not-enabled()
|
||||||
enabled_components=$(command ls "${BASH_IT}"/{"$subdirectory"/,}enabled/*.bash 2>/dev/null | sed 's|^.*/||; s/^[0-9]*---//g')
|
enabled_components=$(command ls "${BASH_IT}"/{"$subdirectory"/,}enabled/*.bash 2>/dev/null | sed 's|^.*/||; s/^[0-9]*---//g')
|
||||||
available_things=$(echo "$all_things" | sort -d | grep -Fxv "$enabled_components" | sed 's/\(.*\)\..*\.bash/\1/g')
|
available_things=$(echo "$all_things" | sort -d | grep -Fxv "$enabled_components" | sed 's/\(.*\)\..*\.bash/\1/g')
|
||||||
|
|
||||||
COMPREPLY=( $(compgen -W "all ${available_things}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "all ${available_things}" -- "${cur}") )
|
||||||
}
|
}
|
||||||
|
|
||||||
_bash-it-comp-list-enabled()
|
_bash-it-comp-list-enabled()
|
||||||
|
|
@ -28,7 +28,7 @@ _bash-it-comp-list-enabled()
|
||||||
|
|
||||||
enabled_things=$(sort -d <(compgen -G "${BASH_IT}/$subdirectory/enabled/*.${suffix}.bash") <(compgen -G "${BASH_IT}/enabled/*.${suffix}.bash") | sed 's|^.*/||; s/\(.*\)\..*\.bash/\1/g; s/^[0-9]*---//g')
|
enabled_things=$(sort -d <(compgen -G "${BASH_IT}/$subdirectory/enabled/*.${suffix}.bash") <(compgen -G "${BASH_IT}/enabled/*.${suffix}.bash") | sed 's|^.*/||; s/\(.*\)\..*\.bash/\1/g; s/^[0-9]*---//g')
|
||||||
|
|
||||||
COMPREPLY=( $(compgen -W "all ${enabled_things}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "all ${enabled_things}" -- "${cur}") )
|
||||||
}
|
}
|
||||||
|
|
||||||
_bash-it-comp-list-available()
|
_bash-it-comp-list-available()
|
||||||
|
|
@ -39,7 +39,7 @@ _bash-it-comp-list-available()
|
||||||
|
|
||||||
enabled_things=$(sort -d <(compgen -G "${BASH_IT}/$subdirectory/available/*.bash") | sed 's|^.*/||; s/\(.*\)\..*\.bash/\1/g')
|
enabled_things=$(sort -d <(compgen -G "${BASH_IT}/$subdirectory/available/*.bash") | sed 's|^.*/||; s/\(.*\)\..*\.bash/\1/g')
|
||||||
|
|
||||||
COMPREPLY=( $(compgen -W "${enabled_things}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${enabled_things}" -- "${cur}") )
|
||||||
}
|
}
|
||||||
|
|
||||||
_bash-it-comp()
|
_bash-it-comp()
|
||||||
|
|
@ -54,7 +54,7 @@ _bash-it-comp()
|
||||||
case "${chose_opt}" in
|
case "${chose_opt}" in
|
||||||
show)
|
show)
|
||||||
local show_args="aliases completions plugins"
|
local show_args="aliases completions plugins"
|
||||||
COMPREPLY=( $(compgen -W "${show_args}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${show_args}" -- "${cur}") )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
help)
|
help)
|
||||||
|
|
@ -63,22 +63,22 @@ _bash-it-comp()
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
local help_args="aliases completions migrate plugins update"
|
local help_args="aliases completions migrate plugins update"
|
||||||
COMPREPLY=( $(compgen -W "${help_args}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${help_args}" -- "${cur}") )
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
doctor)
|
doctor)
|
||||||
local doctor_args="errors warnings all"
|
local doctor_args="errors warnings all"
|
||||||
COMPREPLY=( $(compgen -W "${doctor_args}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${doctor_args}" -- "${cur}") )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
update)
|
update)
|
||||||
if [[ ${cur} == -* ]];then
|
if [[ "${cur}" == -* ]];then
|
||||||
local update_args="-s --silent"
|
local update_args="-s --silent"
|
||||||
else
|
else
|
||||||
local update_args="stable dev"
|
local update_args="stable dev"
|
||||||
fi
|
fi
|
||||||
COMPREPLY=( $(compgen -W "${update_args}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${update_args}" -- "${cur}") )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
migrate | reload | search | version)
|
migrate | reload | search | version)
|
||||||
|
|
@ -111,7 +111,7 @@ _bash-it-comp()
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue