mirror of
https://github.com/docker/cli.git
synced 2026-09-28 02:06:53 -04:00
Add before and since filter to images
Add support for two now filter on the `images` command : `before` and
`since`. They work the same as the one on the `ps` command but for
images.
$ docker images --filter before=myimage
# display all images older than myimage
$ docker images --filter since=myimage
# display all images younger than myimage
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
committed by
Tibor Vass
parent
dd83546376
commit
aac0a3ee13
@@ -1104,6 +1104,11 @@ _docker_history() {
|
||||
_docker_images() {
|
||||
local key=$(__docker_map_key_of_current_option '--filter|-f')
|
||||
case "$key" in
|
||||
before)
|
||||
cur="${cur##*=}"
|
||||
__docker_complete_images
|
||||
return
|
||||
;;
|
||||
dangling)
|
||||
COMPREPLY=( $( compgen -W "false true" -- "${cur##*=}" ) )
|
||||
return
|
||||
@@ -1111,11 +1116,16 @@ _docker_images() {
|
||||
label)
|
||||
return
|
||||
;;
|
||||
since)
|
||||
cur="${cur##*=}"
|
||||
__docker_complete_images
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$prev" in
|
||||
--filter|-f)
|
||||
COMPREPLY=( $( compgen -S = -W "dangling label" -- "$cur" ) )
|
||||
COMPREPLY=( $( compgen -S = -W "before dangling label since" -- "$cur" ) )
|
||||
__docker_nospace
|
||||
return
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user