Browse code

Make zsh completion work when ps output is custom

When `psFormat` is used in the docker client config json, if the output
is non-standard it breaks some of the completion handling for
containers.

This fixes that by ensuring that calls to `ps` use the default/standard
formatting by calling `docker ps --format 'table'`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Brian Goff authored on 2016/05/02 22:45:01
Showing 1 changed files
... ...
@@ -57,7 +57,7 @@ __docker_get_containers() {
57 57
     type=$1; shift
58 58
     [[ $kind = (stopped|all) ]] && args=($args -a)
59 59
 
60
-    lines=(${(f)"$(_call_program commands docker $docker_options ps --no-trunc $args)"})
60
+    lines=(${(f)"$(_call_program commands docker $docker_options ps --format 'table' --no-trunc $args)"})
61 61
 
62 62
     # Parse header line to find columns
63 63
     local i=1 j=1 k header=${lines[1]}