From 786163b5168ff1148aaddc861d3cd590f57a30c3 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 18 Nov 2015 08:08:43 +0100 Subject: [PATCH] zsh: ensure we have enough commands to store in the cache Otherwise, the cache would be invalid and won't be refreshed soon. This can happen when the user has the completion installed before docker is installed. Signed-off-by: Vincent Bernat Upstream-commit: 00ea341609cba3353980403200f5ac94ea00a0c7 Component: cli --- components/cli/contrib/completion/zsh/_docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cli/contrib/completion/zsh/_docker b/components/cli/contrib/completion/zsh/_docker index 7f883c7b54..91eb563584 100644 --- a/components/cli/contrib/completion/zsh/_docker +++ b/components/cli/contrib/completion/zsh/_docker @@ -431,7 +431,7 @@ __docker_commands() { lines=(${(f)"$(_call_program commands docker 2>&1)"}) _docker_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/ ##/:}) _docker_subcommands=($_docker_subcommands 'daemon:Enable daemon mode' 'help:Show help for a command') - _store_cache docker_subcommands _docker_subcommands + (( $#_docker_subcommands > 2 )) && _store_cache docker_subcommands _docker_subcommands fi _describe -t docker-commands "docker command" _docker_subcommands }