5167450ef98c1b0fb05b68006412915320a98501

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #3424 from bergvandenp/docker_exec

added exec command to docker plugin

Diff

 1diff --git a/plugins/docker/_docker b/plugins/docker/_docker
 2index 28568a6e5d0841bd8090a75f1e28b0221332134b..880b6faa6fec9de9241f376209beca5b3e76d6cd 100644
 3--- a/plugins/docker/_docker
 4+++ b/plugins/docker/_docker
 5@@ -4,6 +4,7 @@
 6 # Requires: Docker installed
 7 # Author: Azaan (@aeonazaan)
 8 # Updates: Bob Maerten (@bobmaerten) for Docker v0.9+
 9+#          Paul van den Berg (@bergvandenp) for Docker v1.3+ 
10 
11 
12 # ----- Helper functions
13@@ -238,6 +239,14 @@ __wait() {
14     __docker_containers
15 }
16 
17+__exec() {
18+    _arguments \
19+      '(-d,--detach=)'{-d,--detach=}'[Detached mode: run command in the background]' \
20+      '(-i,--interactive=)'{-i,--interactive=}'[Keep STDIN open even if not attached]' \
21+      '(-t,--tty=)'{-t,--tty=}'[Allocate a pseudo-TTY]'
22+    __docker_containers
23+}
24+
25 # end commands ---------
26 # ----------------------
27 
28@@ -276,6 +285,7 @@ _1st_arguments=(
29     "top":"Lookup the running processes of a container"
30     "version":"Show the docker version information"
31     "wait":"Block until a container stops, then print its exit code"
32+    "exec":"Run a task inside a running container"
33 )
34 
35 _arguments '*:: :->command'
36@@ -353,4 +363,6 @@ case "$words[1]" in
37         __version ;;
38     wait)
39         __wait ;;
40+    exec)
41+        __exec ;;
42 esac