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>
This commit is contained in:
Brian Goff 2016-05-02 09:45:01 -04:00 committed by Tibor Vass
parent 7d3bb7a6d0
commit 8b38343e46
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ __docker_get_containers() {
type=$1; shift type=$1; shift
[[ $kind = (stopped|all) ]] && args=($args -a) [[ $kind = (stopped|all) ]] && args=($args -a)
lines=(${(f)"$(_call_program commands docker $docker_options ps --no-trunc $args)"}) lines=(${(f)"$(_call_program commands docker $docker_options ps --format 'table' --no-trunc $args)"})
# Parse header line to find columns # Parse header line to find columns
local i=1 j=1 k header=${lines[1]} local i=1 j=1 k header=${lines[1]}