summaryrefslogtreecommitdiff
path: root/plugins/docker/_docker
diff options
context:
space:
mode:
authorKennedy Oliveira <kennedy.oliveira@outlook.com>2015-04-29 15:17:11 -0300
committerKennedy Oliveira <kennedy.oliveira@outlook.com>2015-04-29 15:17:11 -0300
commit2dbf9951d92e1f63672da3721b23b1d53b5cfa31 (patch)
treea8a0a99c0b2a92f60c9c24f50c7d284ee9855b3d /plugins/docker/_docker
parentff4663a6b83b8dd205da3968de4bc458abc08b2c (diff)
downloadzsh-2dbf9951d92e1f63672da3721b23b1d53b5cfa31.tar.gz
zsh-2dbf9951d92e1f63672da3721b23b1d53b5cfa31.tar.bz2
zsh-2dbf9951d92e1f63672da3721b23b1d53b5cfa31.zip
Fixing some issues where show repeated weird values, and fixed commands that need the container autocomplete without being running, like start, now it autocompletes showing all the containers so you can start without knowing the right name
Diffstat (limited to 'plugins/docker/_docker')
-rw-r--r--plugins/docker/_docker21
1 files changed, 16 insertions, 5 deletions
diff --git a/plugins/docker/_docker b/plugins/docker/_docker
index aadc9c61d..fd459a0ca 100644
--- a/plugins/docker/_docker
+++ b/plugins/docker/_docker
@@ -12,7 +12,16 @@
__docker_containers() {
declare -a cont_cmd
cont_cmd=($(docker ps | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
- _describe 'containers' cont_cmd
+ if [[ 'X$cont_cmd' != 'X' ]]
+ _describe 'containers' cont_cmd
+}
+
+# Output a selectable list of all containers, even not running
+__docker_all_containers() {
+ declare -a cont_cmd
+ cont_cmd=($(docker ps -a | awk 'NR>1{print $NF":[CON("$1")"$2"("$3")]"}'))
+ if [[ 'X$cont_cmd' != 'X' ]]
+ _describe 'containers' cont_cmd
}
# output a selectable list of all docker images
@@ -57,7 +66,7 @@ __diff() {
__docker_containers
}
-__events() {
+__events() {
_arguments \
'--since=[Show previously created events and then stream.]'
}
@@ -98,10 +107,12 @@ __insert() {
__inspect() {
__docker_images
- __docker_containers
+ __docker_all_containers
}
__kill() {
+ _arguments \
+ '(-s,--signal=)'{-s,--signal=}'[KILL Signal]'
__docker_containers
}
@@ -162,7 +173,7 @@ __rm() {
'(-f,--force=)'{-f,--force=}'[Force removal of running container]' \
'(-l,--link=)'{-l,--link=}'[Remove the specified link and not the underlying container]' \
'(-v,--volumes=)'{-v,--volumes=}'[Remove the volumes associated to the container]'
- __docker_containers
+ __docker_all_containers
}
__rmi() {
@@ -216,7 +227,7 @@ __start() {
_arguments \
'(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \
'(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]'
- __docker_containers
+ __docker_all_containers
}
__stats() {