mirror of https://github.com/docker/cli.git
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 <vincent@bernat.im>
This commit is contained in:
parent
7eac998e7d
commit
00ea341609
|
@ -431,7 +431,7 @@ __docker_commands() {
|
||||||
lines=(${(f)"$(_call_program commands docker 2>&1)"})
|
lines=(${(f)"$(_call_program commands docker 2>&1)"})
|
||||||
_docker_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/ ##/:})
|
_docker_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/ ##/:})
|
||||||
_docker_subcommands=($_docker_subcommands 'daemon:Enable daemon mode' 'help:Show help for a command')
|
_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
|
fi
|
||||||
_describe -t docker-commands "docker command" _docker_subcommands
|
_describe -t docker-commands "docker command" _docker_subcommands
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue