Filter containers by status.

A continuation of #7616.
Closes #7616.
Adds `docker ps --filter=status=(restarting|running|paused|exited)` option.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
well this is only in the tests, so if it makes you feel better the only
people who see the output of these commands are those hacking on docker,
not all users.

On Wed, Oct 1, 2014 at 10:06 AM, O.S. Tezer <notifications@github.com>
wrote:

> In integration-cli/docker_cli_ps_test.go:
>
> > +
> > +	// filter containers by exited
> > +	runCmd = exec.Command(dockerBinary, "ps", "-a", "-q", "--filter=status=exited")
> > +	out, _, err = runCommandWithOutput(runCmd)
> > +	errorOut(err, t, out)
> > +	containerOut := strings.TrimSpace(out)
> > +	if containerOut != firstID[:12] {
> > +		t.Fatalf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out)
> > +	}
> > +
> > +	runCmd = exec.Command(dockerBinary, "ps", "-a", "-q", "--filter=status=running")
> > +	out, _, err = runCommandWithOutput(runCmd)
> > +	errorOut(err, t, out)
> > +	containerOut = strings.TrimSpace(out)
> > +	if containerOut != secondID[:12] {
> > +		t.Fatalf("Expected id %s, got %s for running filter, output: %q", secondID[:12], containerOut, out)
>
> I'd rather have this as ID but no biggie if it LGT everybody else.
> Because not sure about being consistent with faulting and erring side of
> things - unless of course there is an on-the-way PR to fix this en masse.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/docker/docker/pull/8263/files#r18292313>.
>