/
docker-completion.rb
33 lines (28 loc) 路 1.05 KB
/
docker-completion.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class DockerCompletion < Formula
desc "Bash, Zsh and Fish completion for Docker"
homepage "https://www.docker.com/"
url "https://github.com/docker/cli.git",
tag: "v26.1.0",
revision: "9714adc6c797755f63053726c56bc1c17c0c9204"
license "Apache-2.0"
head "https://github.com/docker/cli.git", branch: "master"
livecheck do
formula "docker"
end
bottle do
sha256 cellar: :any_skip_relocation, all: "ccc43ab17ca17acabf436db921c00d45f7fb8bc0be136e8599597f339da9cfc7"
end
# These used to also be provided by the `docker` formula.
link_overwrite "etc/bash_completion.d/docker"
link_overwrite "share/fish/vendor_completions.d/docker.fish"
link_overwrite "share/zsh/site-functions/_docker"
def install
bash_completion.install "contrib/completion/bash/docker"
fish_completion.install "contrib/completion/fish/docker.fish"
zsh_completion.install "contrib/completion/zsh/_docker"
end
test do
assert_match "-F _docker",
shell_output("bash -c 'source #{bash_completion}/docker && complete -p docker'")
end
end