diff --git a/cli/src/main.rs b/cli/src/main.rs index 3bb8c8bc..0be011f9 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -512,7 +512,7 @@ async fn main() -> eyre::Result<()> { }, WormholeCommand::Completion { shell } => { let mut cmd = WormholeCli::command(); - let binary_name = cmd.get_name().to_string(); + let binary_name = env!("CARGO_BIN_NAME"); match shell { shell @ clap_complete::Shell::Zsh => { @@ -520,7 +520,7 @@ async fn main() -> eyre::Result<()> { // this way we can source it directly `source <(wormhole-rs completion zsh)` let mut out = Vec::new(); - clap_complete::generate(shell, &mut cmd, &binary_name, &mut out); + clap_complete::generate(shell, &mut cmd, binary_name, &mut out); let out = String::from_utf8(out) .expect("Internal error: shell completion not UTF-8 encoded"); let out = format!( @@ -1212,10 +1212,10 @@ mod test { for shell in clap_complete::Shell::value_variants() { let mut cmd = WormholeCli::command(); - let binary_name = cmd.get_name().to_string(); + let binary_name = env!("CARGO_BIN_NAME"); let mut out = Vec::new(); - clap_complete::generate(*shell, &mut cmd, &binary_name, &mut out); + clap_complete::generate(*shell, &mut cmd, binary_name, &mut out); String::from_utf8(out).unwrap(); } }