mirror of https://github.com/docker/cli.git
Add a new "is-task" ps filter
This makes it easier to list containers that are part of a task (swarm mode) and those who are not. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
247a2f112b
commit
cd547751df
|
@ -2181,6 +2181,10 @@ _docker_ps() {
|
||||||
__docker_complete_container_ids
|
__docker_complete_container_ids
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
is-task)
|
||||||
|
COMPREPLY=( $( compgen -W "true false" -- "${cur##*=}" ) )
|
||||||
|
return
|
||||||
|
;;
|
||||||
name)
|
name)
|
||||||
cur="${cur##*=}"
|
cur="${cur##*=}"
|
||||||
__docker_complete_container_names
|
__docker_complete_container_names
|
||||||
|
|
|
@ -333,6 +333,9 @@ __docker_complete_ps_filters() {
|
||||||
(id)
|
(id)
|
||||||
__docker_containers_ids && ret=0
|
__docker_containers_ids && ret=0
|
||||||
;;
|
;;
|
||||||
|
(is-task)
|
||||||
|
_describe -t boolean-filter-opts "filter options" boolean_opts && ret=0
|
||||||
|
;;
|
||||||
(name)
|
(name)
|
||||||
__docker_containers_names && ret=0
|
__docker_containers_names && ret=0
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -27,6 +27,7 @@ Options:
|
||||||
- since=(<container-name>|<container-id>)
|
- since=(<container-name>|<container-id>)
|
||||||
- ancestor=(<image-name>[:tag]|<image-id>|<image@digest>)
|
- ancestor=(<image-name>[:tag]|<image-id>|<image@digest>)
|
||||||
containers created from an image or a descendant.
|
containers created from an image or a descendant.
|
||||||
|
- is-task=(true|false)
|
||||||
--format string Pretty-print containers using a Go template
|
--format string Pretty-print containers using a Go template
|
||||||
--help Print usage
|
--help Print usage
|
||||||
-n, --last int Show n last created containers (includes all states) (default -1)
|
-n, --last int Show n last created containers (includes all states) (default -1)
|
||||||
|
|
|
@ -32,6 +32,7 @@ the running containers.
|
||||||
- status=(created|restarting|running|paused|exited|dead)
|
- status=(created|restarting|running|paused|exited|dead)
|
||||||
- name=<string> a container's name
|
- name=<string> a container's name
|
||||||
- id=<ID> a container's ID
|
- id=<ID> a container's ID
|
||||||
|
- is-task=(true|false) - containers that are a task (part of a service managed by swarm)
|
||||||
- before=(<container-name>|<container-id>)
|
- before=(<container-name>|<container-id>)
|
||||||
- since=(<container-name>|<container-id>)
|
- since=(<container-name>|<container-id>)
|
||||||
- ancestor=(<image-name>[:tag]|<image-id>|<image@digest>) - containers created from an image or a descendant.
|
- ancestor=(<image-name>[:tag]|<image-id>|<image@digest>) - containers created from an image or a descendant.
|
||||||
|
|
Loading…
Reference in New Issue