Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions contrib/completion/bash/docker
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,9 @@ _docker_container_run_and_create() {
--io-maxiops
--isolation
"
__docker_daemon_is_experimental && options_with_args+="
--platform
"

local boolean_options="
--disable-content-trust=false
Expand Down Expand Up @@ -2472,10 +2475,15 @@ _docker_image_build() {
--quiet -q
--rm
"
__docker_daemon_is_experimental && boolean_options+="
--squash
--stream
"
if __docker_daemon_is_experimental ; then
options_with_args+="
--platform
"
boolean_options+="
--squash
--stream
"
fi

local all_options="$options_with_args $boolean_options"

Expand Down Expand Up @@ -2687,12 +2695,21 @@ _docker_image_prune() {
}

_docker_image_pull() {
case "$prev" in
--platform)
return
;;
esac

case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--all-tags -a --disable-content-trust=false --help" -- "$cur" ) )
local options="--all-tags -a --disable-content-trust=false --help"
__docker_daemon_is_experimental && options+=" --platform"

COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
local counter=$(__docker_pos_first_nonflag --platform)
if [ "$cword" -eq "$counter" ]; then
for arg in "${COMP_WORDS[@]}"; do
case "$arg" in
Expand Down