Ability to select containers also by names

Fixes #2803
This commit is contained in:
Bob Maerten 2014-10-20 16:27:23 +02:00
commit e43932a121

View file

@ -10,9 +10,11 @@
# ----- Helper functions
# Output a selectable list of all running docker containers
__docker_containers() {
declare -a cont_cmd
cont_cmd=($(docker ps | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
_describe 'containers' cont_cmd
declare -a contid_cmd
contid_cmd=($(docker ps | awk 'NR>1{print $1":[CON("$1")"$2"("$3")]"}'))
cont_cmd=($(docker ps | awk 'NR>1{print $NF}'))
_describe 'containersID' contid_cmd
_describe 'containersNames' cont_cmd
}
# output a selectable list of all docker images