Skip to content

Commit

Permalink
Merge pull request #1995 from burjui/master
Browse files Browse the repository at this point in the history
Fix generation of Cargo completions for ZSH (issue #1821)
  • Loading branch information
kinnison committed Sep 17, 2019
2 parents 0ec2dbe + 05e11e0 commit 1e6b056
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cli/rustup_mode.rs
Expand Up @@ -1309,6 +1309,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 1e6b056

Please sign in to comment.