diff --git a/Formula/docker-completion.rb b/Formula/docker-completion.rb new file mode 100644 index 00000000000..0b1f78d1f5d --- /dev/null +++ b/Formula/docker-completion.rb @@ -0,0 +1,23 @@ +class DockerCompletion < Formula + desc "Bash, Zsh and Fish completion for Docker" + homepage "https://github.com/docker/docker" + url "https://github.com/docker/docker/archive/v1.13.0.tar.gz" + sha256 "845cc9a7a48ed1cc60f062882285358a1c2a845b74c5d1d859606a28e4a47d3e" + head "https://github.com/docker/docker" + + bottle :unneeded + + conflicts_with "docker", + :because => "docker already includes these completion scripts" + + 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