From c49d3274067055dc830d97f1490a84aa73e403e6 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Wed, 25 May 2016 09:35:33 +0200 Subject: [PATCH] bash completion for `docker ps -f {before,since}` Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 29fcf687f7..7652c91cce 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1489,6 +1489,11 @@ _docker_ps() { __docker_complete_images return ;; + before) + cur="${cur##*=}" + __docker_complete_containers_all + return + ;; id) cur="${cur##*=}" __docker_complete_container_ids @@ -1499,6 +1504,11 @@ _docker_ps() { __docker_complete_container_names return ;; + since) + cur="${cur##*=}" + __docker_complete_containers_all + return + ;; status) COMPREPLY=( $( compgen -W "created dead exited paused restarting running" -- "${cur##*=}" ) ) return @@ -1511,11 +1521,8 @@ _docker_ps() { esac case "$prev" in - --before|--since) - __docker_complete_containers_all - ;; --filter|-f) - COMPREPLY=( $( compgen -S = -W "ancestor exited id label name status volume" -- "$cur" ) ) + COMPREPLY=( $( compgen -S = -W "ancestor before exited id label name since status volume" -- "$cur" ) ) __docker_nospace return ;; @@ -1526,7 +1533,7 @@ _docker_ps() { case "$cur" in -*) - COMPREPLY=( $( compgen -W "--all -a --before --filter -f --format --help --latest -l -n --no-trunc --quiet -q --size -s --since" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--all -a --filter -f --format --help --latest -l -n --no-trunc --quiet -q --size -s" -- "$cur" ) ) ;; esac }