From 945515f37390139f22896590c3a9fcbc3f82859e Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Sat, 22 Oct 2016 08:54:53 -0700 Subject: [PATCH] Add bash completion for new `docker image` command family Signed-off-by: Harald Albers Upstream-commit: 33910a89b930bfba2f85188260a9d105d0b96c50 Component: engine --- .../engine/contrib/completion/bash/docker | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/components/engine/contrib/completion/bash/docker b/components/engine/contrib/completion/bash/docker index c4b79962c6..9687df0506 100644 --- a/components/engine/contrib/completion/bash/docker +++ b/components/engine/contrib/completion/bash/docker @@ -2028,6 +2028,106 @@ _docker_history() { esac } + +_docker_image() { + local subcommands=" + build + history + import + inspect + load + ls + prune + pull + push + rm + save + tag + " + local aliases=" + images + list + remove + rmi + " + __docker_subcommands "$subcommands $aliases" && return + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W "--help" -- "$cur" ) ) + ;; + *) + COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) ) + ;; + esac +} + +_docker_image_build() { + _docker_build +} + +_docker_image_history() { + _docker_history +} + +_docker_image_images() { + _docker_image_ls +} + +_docker_image_import() { + _docker_import +} + +_docker_image_inspect() { + _docker_inspect +} + +_docker_image_load() { + _docker_load +} + +_docker_image_list() { + _docker_image_ls +} + +_docker_image_ls() { + _docker_images +} + +# TODO new command +_docker_image_prune() { + : +} + +_docker_image_pull() { + _docker_pull +} + +_docker_image_push() { + _docker_push +} + +_docker_image_remove() { + _docker_image_rm +} + +_docker_image_rm() { + _docker_rmi +} + +_docker_image_rmi() { + _docker_image_rm +} + +_docker_image_save() { + _docker_save +} + +_docker_image_tag() { + _docker_tag +} + + _docker_images() { local key=$(__docker_map_key_of_current_option '--filter|-f') case "$key" in @@ -3178,6 +3278,7 @@ _docker() { exec export history + image images import info