Skip to content

Commit 3d11292

Browse files
authored
Merge pull request #4505 from guss77/docker-cli-slows-bash-init
Docker cli slows bash init
2 parents b3f8207 + 1da67be commit 3d11292

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

contrib/completion/bash/docker

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,10 @@ __docker_complete_user_group() {
11421142
fi
11431143
}
11441144

1145-
DOCKER_PLUGINS_PATH=$(docker info --format '{{range .ClientInfo.Plugins}}{{.Path}}:{{end}}')
1145+
__docker_plugins_path() {
1146+
local docker_plugins_path=$(docker info --format '{{range .ClientInfo.Plugins}}{{.Path}}:{{end}}')
1147+
echo "${docker_plugins_path//:/ }"
1148+
}
11461149

11471150
__docker_complete_plugin() {
11481151
local path=$1
@@ -5504,7 +5507,7 @@ _docker() {
55045507
# Create completion functions for all registered plugins
55055508
local known_plugin_commands=()
55065509
local plugin_name=""
5507-
for plugin_path in ${DOCKER_PLUGINS_PATH//:/ }; do
5510+
for plugin_path in $(__docker_plugins_path); do
55085511
plugin_name=$(basename "$plugin_path" | sed 's/ *$//')
55095512
plugin_name=${plugin_name#docker-}
55105513
plugin_name=${plugin_name%%.*}

0 commit comments

Comments
 (0)