Merge pull request #22974 from albers/completion-ps-filters
bash completion for `docker ps -f {before,since}`
This commit is contained in:
commit
5383824e08
1 changed files with 12 additions and 5 deletions
|
@ -1489,6 +1489,11 @@ _docker_ps() {
|
||||||
__docker_complete_images
|
__docker_complete_images
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
before)
|
||||||
|
cur="${cur##*=}"
|
||||||
|
__docker_complete_containers_all
|
||||||
|
return
|
||||||
|
;;
|
||||||
id)
|
id)
|
||||||
cur="${cur##*=}"
|
cur="${cur##*=}"
|
||||||
__docker_complete_container_ids
|
__docker_complete_container_ids
|
||||||
|
@ -1499,6 +1504,11 @@ _docker_ps() {
|
||||||
__docker_complete_container_names
|
__docker_complete_container_names
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
since)
|
||||||
|
cur="${cur##*=}"
|
||||||
|
__docker_complete_containers_all
|
||||||
|
return
|
||||||
|
;;
|
||||||
status)
|
status)
|
||||||
COMPREPLY=( $( compgen -W "created dead exited paused restarting running" -- "${cur##*=}" ) )
|
COMPREPLY=( $( compgen -W "created dead exited paused restarting running" -- "${cur##*=}" ) )
|
||||||
return
|
return
|
||||||
|
@ -1511,11 +1521,8 @@ _docker_ps() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
--before|--since)
|
|
||||||
__docker_complete_containers_all
|
|
||||||
;;
|
|
||||||
--filter|-f)
|
--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
|
__docker_nospace
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
@ -1526,7 +1533,7 @@ _docker_ps() {
|
||||||
|
|
||||||
case "$cur" in
|
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
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue