Skip to content

Commit

Permalink
docker-shell: add completion
Browse files Browse the repository at this point in the history
  • Loading branch information
gportay committed Nov 16, 2023
1 parent 972e1a2 commit 4c2abee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions support/docker-shell
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
Expand Down

0 comments on commit 4c2abee

Please sign in to comment.