Add bash completion for `docker plugin upgrade`
(cherry picked from commit c9fa3eed1b38cc3056107ab2d1572f829a513062)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -3367,6 +3367,7 @@ _docker_plugin() {
|
| 3367 | 3367 |
push |
| 3368 | 3368 |
rm |
| 3369 | 3369 |
set |
| 3370 |
+ upgrade |
|
| 3370 | 3371 |
" |
| 3371 | 3372 |
local aliases=" |
| 3372 | 3373 |
list |
| ... | ... |
@@ -3521,6 +3522,25 @@ _docker_plugin_set() {
|
| 3521 | 3521 |
esac |
| 3522 | 3522 |
} |
| 3523 | 3523 |
|
| 3524 |
+_docker_plugin_upgrade() {
|
|
| 3525 |
+ case "$cur" in |
|
| 3526 |
+ -*) |
|
| 3527 |
+ COMPREPLY=( $( compgen -W "--disable-content-trust --grant-all-permissions --help --skip-remote-check" -- "$cur" ) ) |
|
| 3528 |
+ ;; |
|
| 3529 |
+ *) |
|
| 3530 |
+ local counter=$(__docker_pos_first_nonflag) |
|
| 3531 |
+ if [ $cword -eq $counter ]; then |
|
| 3532 |
+ __docker_complete_plugins_installed |
|
| 3533 |
+ __ltrim_colon_completions "$cur" |
|
| 3534 |
+ elif [ $cword -eq $((counter + 1)) ]; then |
|
| 3535 |
+ local plugin_images="$(__docker_plugins_installed)" |
|
| 3536 |
+ COMPREPLY=( $(compgen -S : -W "${plugin_images%:*}" -- "$cur") )
|
|
| 3537 |
+ __docker_nospace |
|
| 3538 |
+ fi |
|
| 3539 |
+ ;; |
|
| 3540 |
+ esac |
|
| 3541 |
+} |
|
| 3542 |
+ |
|
| 3524 | 3543 |
|
| 3525 | 3544 |
_docker_port() {
|
| 3526 | 3545 |
_docker_container_port |