summaryrefslogtreecommitdiff
path: root/plugins/docker/_docker
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/docker/_docker')
-rw-r--r--plugins/docker/_docker9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/docker/_docker b/plugins/docker/_docker
index 880b6faa6..aadc9c61d 100644
--- a/plugins/docker/_docker
+++ b/plugins/docker/_docker
@@ -11,7 +11,7 @@
# Output a selectable list of all running docker containers
__docker_containers() {
declare -a cont_cmd
- cont_cmd=($(docker ps | awk 'NR>1{print $1":[CON("$1")"$2"("$3")]"}'))
+ cont_cmd=($(docker ps | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
_describe 'containers' cont_cmd
}
@@ -219,6 +219,10 @@ __start() {
__docker_containers
}
+__stats() {
+ __docker_containers
+}
+
__stop() {
_arguments \
'(-t,--time=)'{-t,--time=}'[Number of seconds to wait for the container to stop before killing it.]'
@@ -280,6 +284,7 @@ _1st_arguments=(
"save":"Save an image to a tar archive"
"search":"Search for an image in the docker index"
"start":"Start a stopped container"
+ "stats":"Display a live stream of one or more containers' resource usage statistics"
"stop":"Stop a running container"
"tag":"Tag an image into a repository"
"top":"Lookup the running processes of a container"
@@ -351,6 +356,8 @@ case "$words[1]" in
__save ;;
search)
__search ;;
+ stats)
+ __stats ;;
start)
__start ;;
stop)