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