Compare commits

...

2 Commits

Author SHA1 Message Date
David Peter db2590dca5
Merge pull request #1178 from tmccombs/windows-completion-fix
Use file_stem instead of file_name for command for completions
2022-11-18 08:11:04 +01:00
Thayne McCombs 64e642403e Use file_stem instead of file_name for command for completions
Fixes: #1177
2022-11-17 22:22:02 -07:00
2 changed files with 3 additions and 2 deletions

View File

@ -11,11 +11,12 @@
## Bugfixes
- Use fd instead of fd.exe for Powershell completions (when completions are generated on windows)
## Other
# v8.5.3
## Bugfixes

View File

@ -97,7 +97,7 @@ fn print_completions(shell: clap_complete::Shell) -> Result<ExitCode> {
let program_name = first_arg
.as_ref()
.map(Path::new)
.and_then(|path| path.file_name())
.and_then(|path| path.file_stem())
.and_then(|file| file.to_str())
.unwrap_or("fd");
let mut cmd = Opts::command();