Skip to content

Commit 05e11e0

Browse files
committed
Fix generation of Cargo completions for ZSH (issue #1821)
1 parent ec6d1af commit 05e11e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cli/rustup_mode.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,10 @@ fn output_completion_script(shell: Shell, command: CompletionCommand) -> Result<
12481248
cli().gen_completions_to("rustup", shell, &mut term2::stdout());
12491249
}
12501250
CompletionCommand::Cargo => {
1251+
if let Shell::Zsh = shell {
1252+
writeln!(&mut term2::stdout(), "#compdef cargo")?;
1253+
}
1254+
12511255
let script = match shell {
12521256
Shell::Bash => "/etc/bash_completion.d/cargo",
12531257
Shell::Zsh => "/share/zsh/site-functions/_cargo",

0 commit comments

Comments
 (0)