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:
Vincent Demeester
2017-06-02 00:07:40 +00:00
committed by Tibor Vass
parent dd83546376
commit aac0a3ee13
4 changed files with 66 additions and 6 deletions
+11 -1
View File
@@ -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
;;