Fixed case where nothing was enabled

pull/1043/head
Nils Winkler 2017-09-15 08:10:15 +02:00
parent adb2f1071f
commit e7298a5303
2 changed files with 7 additions and 2 deletions

View File

@ -25,7 +25,7 @@ _bash-it-comp-list-enabled()
{
subdirectory="$1"
local enabled_things=$(for f in `ls -1 "${BASH_IT}/$subdirectory/enabled/"*.bash 2>/dev/null`;
local enabled_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/enabled/*.bash"`;
do
basename $f | cut -d'.' -f1 | sed -e "s/^[0-9]*---//g"
done)
@ -37,7 +37,7 @@ _bash-it-comp-list-available()
{
subdirectory="$1"
local enabled_things=$(for f in `ls -1 "${BASH_IT}/$subdirectory/available/"*.bash`;
local enabled_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/available/*.bash"`;
do
basename $f | cut -d'.' -f1
done)

View File

@ -65,6 +65,11 @@ function __check_completion () {
@test "completion bash-it: disable - provide nothing when atom is not enabled" {
run __check_completion 'bash-it disable alias ato'
assert_line "0" ""
}
@test "completion bash-it: disable - provide all when atom is not enabled" {
run __check_completion 'bash-it disable alias a'
assert_line "0" "all"
}