mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix bash completion for docker inspect --type
Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
parent
c5ceb0f945
commit
d65934a8b8
1 changed files with 5 additions and 3 deletions
|
@ -2184,9 +2184,11 @@ _docker_info() {
|
|||
}
|
||||
|
||||
_docker_inspect() {
|
||||
local preselected_type
|
||||
local type
|
||||
|
||||
if [ "$1" = "--type" ] ; then
|
||||
preselected_type=yes
|
||||
type="$2"
|
||||
else
|
||||
type=$(__docker_value_of_option --type)
|
||||
|
@ -2197,17 +2199,17 @@ _docker_inspect() {
|
|||
return
|
||||
;;
|
||||
--type)
|
||||
if [ -z "$type" ] ; then
|
||||
if [ -z "$preselected_type" ] ; then
|
||||
COMPREPLY=( $( compgen -W "image container" -- "$cur" ) )
|
||||
return
|
||||
fi
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
local options="--format -f --help --size -s"
|
||||
if [ -z "$type" ] ; then
|
||||
if [ -z "$preselected_type" ] ; then
|
||||
options+=" --type"
|
||||
fi
|
||||
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
||||
|
|
Loading…
Add table
Reference in a new issue