homebrew-core/Formula/cargo-completion.rb
Rui Chen d50e8f2d77
cargo-completion 0.37.0
Closes #41628.

Signed-off-by: Chongyu Zhu <i@lembacon.com>
2019-07-05 07:40:48 +08:00

22 lines
737 B
Ruby

class CargoCompletion < Formula
desc "Bash and Zsh completion for Cargo"
homepage "https://github.com/rust-lang/cargo"
url "https://github.com/rust-lang/cargo/archive/0.37.0.tar.gz"
sha256 "377e1090e9ce21206270576193746499a26e8ffbd8b89ccd5f8eb1085ca00e3b"
version_scheme 1
head "https://github.com/rust-lang/cargo.git"
bottle :unneeded
def install
bash_completion.install "src/etc/cargo.bashcomp.sh" => "cargo"
zsh_completion.install "src/etc/_cargo"
end
test do
# we need to define a dummy 'cargo' command to force the script to define
# the completion function
assert_match "-F _cargo",
shell_output("cargo() { true;} && source #{bash_completion}/cargo && complete -p cargo")
end
end