Skip to content

Commit 1e6b056

Browse files
authored
Merge pull request #1995 from burjui/master
Fix generation of Cargo completions for ZSH (issue #1821)
2 parents 0ec2dbe + 05e11e0 commit 1e6b056

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cli/rustup_mode.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,10 @@ fn output_completion_script(shell: Shell, command: CompletionCommand) -> Result<
13091309
cli().gen_completions_to("rustup", shell, &mut term2::stdout());
13101310
}
13111311
CompletionCommand::Cargo => {
1312+
if let Shell::Zsh = shell {
1313+
writeln!(&mut term2::stdout(), "#compdef cargo")?;
1314+
}
1315+
13121316
let script = match shell {
13131317
Shell::Bash => "/etc/bash_completion.d/cargo",
13141318
Shell::Zsh => "/share/zsh/site-functions/_cargo",

0 commit comments

Comments
 (0)