فهرست منبع

zsh autocomplete: fix missing services issue for build/pull commands

Previously, the autocomplete for the build/pull commands would only add
services for which build/image were the _first_ keys, respectively, in
the docker-compose file.

This commit fixes this, so the appropriate services are listed
regardless of the order in which they appear

Signed-off-by: Andre Eriksson <[email protected]>
Andre Eriksson 9 سال پیش
والد
کامیت
048408af48
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      contrib/completion/zsh/_docker-compose

+ 2 - 1
contrib/completion/zsh/_docker-compose

@@ -52,7 +52,8 @@ __docker-compose_services_with_key() {
         | sed -n -e '/^services:/,/^[^ ]/p' \
         | sed -n 's/^  //p' \
         | awk '/^[a-zA-Z0-9]/{printf "\n"};{printf $0;next;}' \
-        | awk -F: -v key=": +$1:" '$0 ~ key {print $1}' \
+        | grep " \+$1:" \
+        | sed "s/:.*//g" \
         | grep -Ev "$already_selected"
 }