Checking global directory for completions as well

This commit is contained in:
Nils Winkler
2017-09-15 08:10:15 +02:00
parent 607c9cd049
commit ec327486ef
2 changed files with 13 additions and 2 deletions

View File

@@ -31,9 +31,11 @@ _bash-it-comp-list-available-not-enabled()
_bash-it-comp-list-enabled()
{
local subdirectory="$1"
local suffix enabled_things
# TODO Check for global directory as well
local enabled_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/enabled/*.bash" | sort`;
suffix=$(echo "$subdirectory" | sed -e 's/plugins/plugin/g')
enabled_things=$(for f in `sort <(compgen -G "${BASH_IT}/$subdirectory/enabled/*.${suffix}.bash") <(compgen -G "${BASH_IT}/enabled/*.${suffix}.bash")`;
do
basename $f | cut -d'.' -f1 | sed -e "s/^[0-9]*---//g"
done)