Skip to content

Commit

Permalink
Merge branch 'magic-wormhole:main' into qr-opt-2
Browse files Browse the repository at this point in the history
  • Loading branch information
jherzstein authored Dec 9, 2024
2 parents a4dc757 + c00e94f commit 433f958
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,15 @@ 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 => {
// for zsh, we will wrap the output to make it easier to use
// 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!(
Expand Down Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 433f958

Please sign in to comment.