2014-11-10 20:55:43 +01:00
|
|
|
#!bash
|
|
|
|
#
|
2015-01-21 09:37:07 +01:00
|
|
|
# bash completion for docker-compose
|
2015-01-21 00:22:30 +01:00
|
|
|
#
|
2014-11-10 20:55:43 +01:00
|
|
|
# This work is based on the completion for the docker command.
|
|
|
|
#
|
|
|
|
# This script provides completion of:
|
|
|
|
# - commands and their options
|
|
|
|
# - service names
|
|
|
|
# - filepaths
|
|
|
|
#
|
|
|
|
# To enable the completions either:
|
|
|
|
# - place this file in /etc/bash_completion.d
|
|
|
|
# or
|
2015-01-21 09:37:07 +01:00
|
|
|
# - copy this file to e.g. ~/.docker-compose-completion.sh and add the line
|
|
|
|
# below to your .bashrc after bash completion features are loaded
|
|
|
|
# . ~/.docker-compose-completion.sh
|
2014-11-10 20:55:43 +01:00
|
|
|
|
|
|
|
|
2015-10-17 18:51:37 +02:00
|
|
|
# suppress trailing whitespace
|
|
|
|
__docker_compose_nospace() {
|
|
|
|
# compopt is not available in ancient bash versions
|
|
|
|
type compopt &>/dev/null && compopt -o nospace
|
|
|
|
}
|
|
|
|
|
2015-01-26 19:09:18 +01:00
|
|
|
# For compatibility reasons, Compose and therefore its completion supports several
|
|
|
|
# stack compositon files as listed here, in descending priority.
|
|
|
|
# Support for these filenames might be dropped in some future version.
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_compose_file() {
|
2015-01-26 19:09:18 +01:00
|
|
|
local file
|
|
|
|
for file in docker-compose.y{,a}ml fig.y{,a}ml ; do
|
|
|
|
[ -e $file ] && {
|
|
|
|
echo $file
|
|
|
|
return
|
|
|
|
}
|
|
|
|
done
|
|
|
|
echo docker-compose.yml
|
|
|
|
}
|
|
|
|
|
|
|
|
# Extracts all service names from the compose file.
|
2015-04-17 22:47:28 +02:00
|
|
|
___docker_compose_all_services_in_compose_file() {
|
|
|
|
awk -F: '/^[a-zA-Z0-9]/{print $1}' "${compose_file:-$(__docker_compose_compose_file)}" 2>/dev/null
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# All services, even those without an existing container
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_all() {
|
|
|
|
COMPREPLY=( $(compgen -W "$(___docker_compose_all_services_in_compose_file)" -- "$cur") )
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
2015-01-26 19:09:18 +01:00
|
|
|
# All services that have an entry with the given key in their compose_file section
|
2015-04-17 22:47:28 +02:00
|
|
|
___docker_compose_services_with_key() {
|
2014-11-10 20:55:43 +01:00
|
|
|
# flatten sections to one line, then filter lines containing the key and return section name.
|
2015-09-18 18:12:30 +02:00
|
|
|
awk '/^[a-zA-Z0-9]/{printf "\n"};{printf $0;next;}' "${compose_file:-$(__docker_compose_compose_file)}" 2>/dev/null | awk -F: -v key=": +$1:" '$0 ~ key {print $1}'
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# All services that are defined by a Dockerfile reference
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_from_build() {
|
|
|
|
COMPREPLY=( $(compgen -W "$(___docker_compose_services_with_key build)" -- "$cur") )
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# All services that are defined by an image
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_from_image() {
|
|
|
|
COMPREPLY=( $(compgen -W "$(___docker_compose_services_with_key image)" -- "$cur") )
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# The services for which containers have been created, optionally filtered
|
|
|
|
# by a boolean expression passed in as argument.
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_with() {
|
2014-11-10 20:55:43 +01:00
|
|
|
local containers names
|
2015-01-21 09:37:07 +01:00
|
|
|
containers="$(docker-compose 2>/dev/null ${compose_file:+-f $compose_file} ${compose_project:+-p $compose_project} ps -q)"
|
2014-11-10 20:55:43 +01:00
|
|
|
names=( $(docker 2>/dev/null inspect --format "{{if ${1:-true}}} {{ .Name }} {{end}}" $containers) )
|
|
|
|
names=( ${names[@]%_*} ) # strip trailing numbers
|
|
|
|
names=( ${names[@]#*_} ) # strip project name
|
|
|
|
COMPREPLY=( $(compgen -W "${names[*]}" -- "$cur") )
|
|
|
|
}
|
|
|
|
|
2015-07-25 22:20:58 +02:00
|
|
|
# The services for which at least one paused container exists
|
|
|
|
__docker_compose_services_paused() {
|
|
|
|
__docker_compose_services_with '.State.Paused'
|
|
|
|
}
|
|
|
|
|
2014-11-10 20:55:43 +01:00
|
|
|
# The services for which at least one running container exists
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_running() {
|
|
|
|
__docker_compose_services_with '.State.Running'
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# The services for which at least one stopped container exists
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_stopped() {
|
|
|
|
__docker_compose_services_with 'not .State.Running'
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_build() {
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-09-18 18:12:30 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--help --no-cache --pull" -- "$cur" ) )
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_from_build
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_docker_compose() {
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$prev" in
|
|
|
|
--file|-f)
|
2015-05-06 09:33:22 +02:00
|
|
|
_filedir "y?(a)ml"
|
2014-11-10 20:55:43 +01:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
--project-name|-p)
|
|
|
|
return
|
|
|
|
;;
|
2015-10-17 18:26:32 +02:00
|
|
|
--x-network-driver)
|
|
|
|
COMPREPLY=( $( compgen -W "bridge host none overlay" -- "$cur" ) )
|
|
|
|
return
|
|
|
|
;;
|
2014-11-10 20:55:43 +01:00
|
|
|
esac
|
|
|
|
|
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-10-17 18:26:32 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--file -f --help -h --project-name -p --verbose --version -v --x-networking --x-network-driver" -- "$cur" ) )
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
COMPREPLY=( $( compgen -W "${commands[*]}" -- "$cur" ) )
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_help() {
|
2014-11-10 20:55:43 +01:00
|
|
|
COMPREPLY=( $( compgen -W "${commands[*]}" -- "$cur" ) )
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_kill() {
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$prev" in
|
|
|
|
-s)
|
|
|
|
COMPREPLY=( $( compgen -W "SIGHUP SIGINT SIGKILL SIGUSR1 SIGUSR2" -- "$(echo $cur | tr '[:lower:]' '[:upper:]')" ) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-06-25 21:41:43 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--help -s" -- "$cur" ) )
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_running
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_logs() {
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-06-25 21:41:43 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--help --no-color" -- "$cur" ) )
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_all
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_migrate_to_labels() {
|
2015-06-25 21:41:43 +02:00
|
|
|
case "$cur" in
|
|
|
|
-*)
|
|
|
|
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-07-25 22:20:58 +02:00
|
|
|
_docker_compose_pause() {
|
|
|
|
case "$cur" in
|
|
|
|
-*)
|
|
|
|
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
__docker_compose_services_running
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_port() {
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$prev" in
|
|
|
|
--protocol)
|
|
|
|
COMPREPLY=( $( compgen -W "tcp udp" -- "$cur" ) )
|
|
|
|
return;
|
|
|
|
;;
|
|
|
|
--index)
|
|
|
|
return;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-06-25 21:41:43 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--help --index --protocol" -- "$cur" ) )
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_all
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_ps() {
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-06-25 21:41:43 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--help -q" -- "$cur" ) )
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_all
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_pull() {
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-09-21 11:59:23 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--help --ignore-pull-failures" -- "$cur" ) )
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_from_image
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_restart() {
|
2015-01-21 00:22:30 +01:00
|
|
|
case "$prev" in
|
2015-08-26 18:16:36 +02:00
|
|
|
--timeout|-t)
|
2015-01-21 00:22:30 +01:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-06-25 21:41:43 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
|
2015-01-21 00:22:30 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_running
|
2015-01-21 00:22:30 +01:00
|
|
|
;;
|
|
|
|
esac
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_rm() {
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-06-25 21:41:43 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--force -f --help -v" -- "$cur" ) )
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_stopped
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_run() {
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$prev" in
|
|
|
|
-e)
|
|
|
|
COMPREPLY=( $( compgen -e -- "$cur" ) )
|
2015-10-17 18:51:37 +02:00
|
|
|
__docker_compose_nospace
|
2014-11-10 20:55:43 +01:00
|
|
|
return
|
|
|
|
;;
|
2015-09-18 17:45:35 +02:00
|
|
|
--entrypoint|--name|--user|-u)
|
2014-11-10 20:55:43 +01:00
|
|
|
return
|
2015-01-21 00:22:30 +01:00
|
|
|
;;
|
2014-11-10 20:55:43 +01:00
|
|
|
esac
|
|
|
|
|
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-09-18 17:45:35 +02:00
|
|
|
COMPREPLY=( $( compgen -W "-d --entrypoint -e --help --name --no-deps --publish -p --rm --service-ports -T --user -u" -- "$cur" ) )
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_all
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_scale() {
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$prev" in
|
|
|
|
=)
|
|
|
|
COMPREPLY=("$cur")
|
2015-08-26 17:48:51 +02:00
|
|
|
return
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
2015-08-26 17:57:04 +02:00
|
|
|
--timeout|-t)
|
|
|
|
return
|
|
|
|
;;
|
2014-11-10 20:55:43 +01:00
|
|
|
esac
|
2015-06-25 21:41:43 +02:00
|
|
|
|
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-08-26 17:57:04 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
|
2015-06-25 21:41:43 +02:00
|
|
|
;;
|
2015-08-26 17:48:51 +02:00
|
|
|
*)
|
|
|
|
COMPREPLY=( $(compgen -S "=" -W "$(___docker_compose_all_services_in_compose_file)" -- "$cur") )
|
2015-10-17 18:51:37 +02:00
|
|
|
__docker_compose_nospace
|
2015-08-26 17:48:51 +02:00
|
|
|
;;
|
2015-06-25 21:41:43 +02:00
|
|
|
esac
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_start() {
|
2015-06-25 21:41:43 +02:00
|
|
|
case "$cur" in
|
|
|
|
-*)
|
|
|
|
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_stopped
|
2015-06-25 21:41:43 +02:00
|
|
|
;;
|
|
|
|
esac
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_stop() {
|
2015-01-21 00:22:30 +01:00
|
|
|
case "$prev" in
|
2015-08-26 18:16:36 +02:00
|
|
|
--timeout|-t)
|
2015-01-21 00:22:30 +01:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-06-25 21:41:43 +02:00
|
|
|
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
|
2015-01-21 00:22:30 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_running
|
2015-01-21 00:22:30 +01:00
|
|
|
;;
|
|
|
|
esac
|
2014-11-10 20:55:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-07-25 22:20:58 +02:00
|
|
|
_docker_compose_unpause() {
|
|
|
|
case "$cur" in
|
|
|
|
-*)
|
|
|
|
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
__docker_compose_services_paused
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_up() {
|
2015-01-21 00:22:30 +01:00
|
|
|
case "$prev" in
|
2015-08-26 18:16:36 +02:00
|
|
|
--timeout|-t)
|
2015-01-21 00:22:30 +01:00
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2014-11-10 20:55:43 +01:00
|
|
|
case "$cur" in
|
|
|
|
-*)
|
2015-07-20 18:13:09 +02:00
|
|
|
COMPREPLY=( $( compgen -W "-d --help --no-build --no-color --no-deps --no-recreate --force-recreate --timeout -t" -- "$cur" ) )
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
*)
|
2015-04-17 22:47:28 +02:00
|
|
|
__docker_compose_services_all
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose_version() {
|
2015-06-03 22:25:26 +02:00
|
|
|
case "$cur" in
|
|
|
|
-*)
|
|
|
|
COMPREPLY=( $( compgen -W "--short" -- "$cur" ) )
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
_docker_compose() {
|
2015-05-06 09:33:22 +02:00
|
|
|
local previous_extglob_setting=$(shopt -p extglob)
|
|
|
|
shopt -s extglob
|
|
|
|
|
2014-11-10 20:55:43 +01:00
|
|
|
local commands=(
|
|
|
|
build
|
|
|
|
help
|
|
|
|
kill
|
|
|
|
logs
|
2015-05-20 15:31:10 +02:00
|
|
|
migrate-to-labels
|
2015-07-25 22:20:58 +02:00
|
|
|
pause
|
2014-11-10 20:55:43 +01:00
|
|
|
port
|
|
|
|
ps
|
|
|
|
pull
|
|
|
|
restart
|
|
|
|
rm
|
|
|
|
run
|
|
|
|
scale
|
|
|
|
start
|
|
|
|
stop
|
2015-07-25 22:20:58 +02:00
|
|
|
unpause
|
2014-11-10 20:55:43 +01:00
|
|
|
up
|
2015-06-03 22:25:26 +02:00
|
|
|
version
|
2014-11-10 20:55:43 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
COMPREPLY=()
|
|
|
|
local cur prev words cword
|
|
|
|
_get_comp_words_by_ref -n : cur prev words cword
|
|
|
|
|
|
|
|
# search subcommand and invoke its handler.
|
|
|
|
# special treatment of some top-level options
|
2015-04-17 22:47:28 +02:00
|
|
|
local command='docker_compose'
|
2014-11-10 20:55:43 +01:00
|
|
|
local counter=1
|
2015-01-21 09:37:07 +01:00
|
|
|
local compose_file compose_project
|
2014-11-10 20:55:43 +01:00
|
|
|
while [ $counter -lt $cword ]; do
|
|
|
|
case "${words[$counter]}" in
|
2015-08-26 18:16:36 +02:00
|
|
|
--file|-f)
|
2014-11-10 20:55:43 +01:00
|
|
|
(( counter++ ))
|
2015-01-21 09:37:07 +01:00
|
|
|
compose_file="${words[$counter]}"
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
2015-08-26 18:16:36 +02:00
|
|
|
--project-name|p)
|
2014-11-10 20:55:43 +01:00
|
|
|
(( counter++ ))
|
2015-01-21 09:37:07 +01:00
|
|
|
compose_project="${words[$counter]}"
|
2014-11-10 20:55:43 +01:00
|
|
|
;;
|
2015-10-17 18:26:32 +02:00
|
|
|
--x-network-driver)
|
|
|
|
(( counter++ ))
|
|
|
|
;;
|
2014-11-10 20:55:43 +01:00
|
|
|
-*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
command="${words[$counter]}"
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
(( counter++ ))
|
|
|
|
done
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
local completions_func=_docker_compose_${command//-/_}
|
2014-11-10 20:55:43 +01:00
|
|
|
declare -F $completions_func >/dev/null && $completions_func
|
|
|
|
|
2015-05-06 09:33:22 +02:00
|
|
|
eval "$previous_extglob_setting"
|
2014-11-10 20:55:43 +01:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2015-04-17 22:47:28 +02:00
|
|
|
complete -F _docker_compose docker-compose
|