From 4c2abee130ba3e9b85bdee00bc95ef05e14de3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= Date: Thu, 16 Nov 2023 20:00:36 +0100 Subject: [PATCH] docker-shell: add completion --- support/docker-shell | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/support/docker-shell b/support/docker-shell index 3d7eb51..a42e4e4 100755 --- a/support/docker-shell +++ b/support/docker-shell @@ -19,6 +19,24 @@ EOF exit 0 fi +if [[ "$1" == "__complete" ]] +then + # Called as docker-shell __complete shell + shift + shift + + source /usr/share/bash-completion/bash_completion + source /usr/share/bash-completion/completions/dosh + + COMP_LINE="dosh $*" + COMP_WORDS=(dosh "$@") + COMP_CWORD="$#" + COMP_POINT="${#COMP_LINE}" + _dosh + echo "${COMPREPLY[@]}" + exit 0 +fi + if [[ "$1" == "help" ]] then cat <