diff options
author | Thayne McCombs <astrothayne@gmail.com> | 2022-11-17 22:20:03 -0700 |
---|---|---|
committer | Thayne McCombs <astrothayne@gmail.com> | 2022-11-17 22:22:02 -0700 |
commit | 64e642403ea3df50d0d25c79758cb49db08ac02e (patch) | |
tree | e9c54c7a48ae66fb178318cd0f51a4bf90b4d4ea | |
parent | 38cdeb041364d3a644d3cfd68daf724e0d35b29b (diff) |
Use file_stem instead of file_name for command for completions
Fixes: #1177
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | src/main.rs | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 064edc8..d8be66e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,10 @@ ## Bugfixes +- Use fd instead of fd.exe for Powershell completions (when completions are generated on windows) -## Other +## Other # v8.5.3 diff --git a/src/main.rs b/src/main.rs index 1173b1e..cdc48c7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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(); |