From 347c066e0dff687c9c1c6cd509e495f0ec34c015 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Mon, 16 Jan 2017 10:47:52 +0100 Subject: [PATCH] Add bash completion for `container|image|network prune --filter until` Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 40 ++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 4dc4e53206..3b210d8aa9 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1234,9 +1234,17 @@ _docker_container_port() { } _docker_container_prune() { + case "$prev" in + --filter) + COMPREPLY=( $( compgen -W "until" -S = -- "$cur" ) ) + __docker_nospace + return + ;; + esac + case "$cur" in -*) - COMPREPLY=( $( compgen -W "--force -f --help" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--force -f --filter --help" -- "$cur" ) ) ;; esac } @@ -2170,9 +2178,17 @@ _docker_image_ls() { } _docker_image_prune() { + case "$prev" in + --filter) + COMPREPLY=( $( compgen -W "until" -S = -- "$cur" ) ) + __docker_nospace + return + ;; + esac + case "$cur" in -*) - COMPREPLY=( $( compgen -W "--all -a --force -f --help" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--all -a --force -f --filter --help" -- "$cur" ) ) ;; esac } @@ -2532,9 +2548,17 @@ _docker_network_ls() { } _docker_network_prune() { + case "$prev" in + --filter) + COMPREPLY=( $( compgen -W "until" -S = -- "$cur" ) ) + __docker_nospace + return + ;; + esac + case "$cur" in -*) - COMPREPLY=( $( compgen -W "--force -f --help" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--force -f --filter --help" -- "$cur" ) ) ;; esac } @@ -3811,9 +3835,17 @@ _docker_system_info() { } _docker_system_prune() { + case "$prev" in + --filter) + COMPREPLY=( $( compgen -W "until" -S = -- "$cur" ) ) + __docker_nospace + return + ;; + esac + case "$cur" in -*) - COMPREPLY=( $( compgen -W "--all -a --force -f --help" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--all -a --force -f --filter --help" -- "$cur" ) ) ;; esac }