Skip to content

Commit 7f2bc08

Browse files
committed
refactor
Don't hard-code a name that is already set elesewhere. Reuse it instead.
1 parent eab22bd commit 7f2bc08

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: src/plumbing/main.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1222,12 +1222,11 @@ pub fn main() -> Result<()> {
12221222
Subcommands::Completions { shell, out_dir } => {
12231223
let mut app = Args::command();
12241224

1225-
let bin_name = "gix";
1226-
app.set_bin_name(bin_name);
1227-
12281225
let shell = shell
12291226
.or_else(clap_complete::Shell::from_env)
12301227
.ok_or_else(|| anyhow!("The shell could not be derived from the environment"))?;
1228+
1229+
let bin_name = app.get_name().to_owned();
12311230
if let Some(out_dir) = out_dir {
12321231
clap_complete::generate_to(shell, &mut app, bin_name, &out_dir)?;
12331232
} else {

0 commit comments

Comments
 (0)