Skip to content

Commit

Permalink
Fix generation of Cargo completions for ZSH (issue rust-lang#1821)
Browse files Browse the repository at this point in the history
  • Loading branch information
burjui committed Sep 16, 2019
1 parent ec6d1af commit 05e11e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,10 @@ fn output_completion_script(shell: Shell, command: CompletionCommand) -> Result<
cli().gen_completions_to("rustup", shell, &mut term2::stdout());
}
CompletionCommand::Cargo => {
if let Shell::Zsh = shell {
writeln!(&mut term2::stdout(), "#compdef cargo")?;
}

let script = match shell {
Shell::Bash => "/etc/bash_completion.d/cargo",
Shell::Zsh => "/share/zsh/site-functions/_cargo",
Expand Down

0 comments on commit 05e11e0

Please sign in to comment.