File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1221,13 +1221,17 @@ pub fn main() -> Result<()> {
1221
1221
} ,
1222
1222
Subcommands :: Completions { shell, out_dir } => {
1223
1223
let mut app = Args :: command ( ) ;
1224
+
1225
+ let bin_name = "gix" ;
1226
+ app. set_bin_name ( bin_name) ;
1227
+
1224
1228
let shell = shell
1225
1229
. or_else ( clap_complete:: Shell :: from_env)
1226
1230
. ok_or_else ( || anyhow ! ( "The shell could not be derived from the environment" ) ) ?;
1227
1231
if let Some ( out_dir) = out_dir {
1228
- clap_complete:: generate_to ( shell, & mut app, env ! ( "CARGO_PKG_NAME" ) , & out_dir) ?;
1232
+ clap_complete:: generate_to ( shell, & mut app, bin_name , & out_dir) ?;
1229
1233
} else {
1230
- clap_complete:: generate ( shell, & mut app, env ! ( "CARGO_PKG_NAME" ) , & mut std:: io:: stdout ( ) ) ;
1234
+ clap_complete:: generate ( shell, & mut app, bin_name , & mut std:: io:: stdout ( ) ) ;
1231
1235
}
1232
1236
Ok ( ( ) )
1233
1237
}
You can’t perform that action at this time.
0 commit comments