dotcloud/docker — pull request #3671 by tianon (2014-01-20 08:29:04+00:00)
Title: Update bash completion to ignore stderr output of docker binary

Right now, if the docker daemon has any kind of problem while completion is in progress, the stderr pollutes your screen. This results in things like (I currently have no containers, so `docker ps -a -q` returns the empty list which makes `docker inspect` sad, but similar things happen if the socket is not available for connection):
```console
$ docker run --volumes-from
Usage: docker inspect CONTAINER|IMAGE [CONTAINER|IMAGE...]

Return low-level information on a container/image

-f, --format="": Format the output using the given go template.
```

This is fixed most easily by ignoring stderr (which I've done through a separate `__docker_q` helper function to keep the completion code really easy to read).