Skip to content

Commit d87966d

Browse files
Merge branch 'main' into transit_info
2 parents b666766 + c00e94f commit d87966d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cli/src/main.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -508,15 +508,15 @@ async fn main() -> eyre::Result<()> {
508508
},
509509
WormholeCommand::Completion { shell } => {
510510
let mut cmd = WormholeCli::command();
511-
let binary_name = cmd.get_name().to_string();
511+
let binary_name = env!("CARGO_BIN_NAME");
512512

513513
match shell {
514514
shell @ clap_complete::Shell::Zsh => {
515515
// for zsh, we will wrap the output to make it easier to use
516516
// this way we can source it directly `source <(wormhole-rs completion zsh)`
517517

518518
let mut out = Vec::new();
519-
clap_complete::generate(shell, &mut cmd, &binary_name, &mut out);
519+
clap_complete::generate(shell, &mut cmd, binary_name, &mut out);
520520
let out = String::from_utf8(out)
521521
.expect("Internal error: shell completion not UTF-8 encoded");
522522
let out = format!(
@@ -1208,10 +1208,10 @@ mod test {
12081208

12091209
for shell in clap_complete::Shell::value_variants() {
12101210
let mut cmd = WormholeCli::command();
1211-
let binary_name = cmd.get_name().to_string();
1211+
let binary_name = env!("CARGO_BIN_NAME");
12121212

12131213
let mut out = Vec::new();
1214-
clap_complete::generate(*shell, &mut cmd, &binary_name, &mut out);
1214+
clap_complete::generate(*shell, &mut cmd, binary_name, &mut out);
12151215
String::from_utf8(out).unwrap();
12161216
}
12171217
}

0 commit comments

Comments
 (0)