Skip to content

Commit

Permalink
Merge pull request #611 from albers/completion-stack-deploy--resolve-…
Browse files Browse the repository at this point in the history
…image

Add bash completion for `stack deploy --resolve-image`
  • Loading branch information
thaJeztah authored Oct 11, 2017
2 parents 0a6e1cb + 9559b9b commit 6ef0ea8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contrib/completion/bash/docker
Original file line number Diff line number Diff line change
Expand Up @@ -4346,16 +4346,20 @@ _docker_stack_deploy() {
_filedir yml
return
;;
--resolve-image)
COMPREPLY=( $( compgen -W "always changed never" -- "$cur" ) )
return
;;
esac

case "$cur" in
-*)
local options="--compose-file -c --help --prune --with-registry-auth"
local options="--compose-file -c --help --prune --resolve-image --with-registry-auth"
__docker_daemon_is_experimental && options+=" --bundle-file"
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '--compose-file|-c|--bundle-file')
local counter=$(__docker_pos_first_nonflag '--bundle-file|--compose-file|-c|--resolve-image')
if [ "$cword" -eq "$counter" ]; then
__docker_complete_stacks
fi
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/commandline/stack_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Options:
-c, --compose-file string Path to a Compose file
--help Print usage
--prune Prune services that are no longer referenced
--resolve-image string Query the registry to resolve image digest and supported platforms
("always"|"changed"|"never") (default "always")
--with-registry-auth Send registry authentication details to Swarm agents
```

Expand Down

0 comments on commit 6ef0ea8

Please sign in to comment.