fix(cli): incorrect bin name in shell completions (#6444)

Signed-off-by: Sai Karthik <kskarthik@disroot.org>
This commit is contained in:
Sai Karthik
2026-01-12 22:39:59 +05:30
committed by GitHub
parent 7a4d047538
commit 26c5a6c1dd
+4 -2
View File
@@ -854,6 +854,9 @@ enum Command {
Completion {
#[arg(value_enum)]
shell: ClapShell,
#[arg(long, default_value = "goose", help = "Provide a custom binary name")]
bin_name: String,
},
}
@@ -1438,9 +1441,8 @@ pub async fn cli() -> anyhow::Result<()> {
);
match cli.command {
Some(Command::Completion { shell }) => {
Some(Command::Completion { shell, bin_name }) => {
let mut cmd = Cli::command();
let bin_name = cmd.get_name().to_string();
generate(shell, &mut cmd, bin_name, &mut std::io::stdout());
Ok(())
}