Skip to content

Commit 9f608d3

Browse files
committed
Changed fdfind completions for zsh and bash
Use autoload instead of source for zsh Dont use complete command to catch options for compdef in bash
1 parent d2369ae commit 9f608d3

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

contrib/completion/_fdfind

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
#compdef fdfind
22

3-
# Source completions from fd
4-
source /usr/share/zsh/vendor-completions/_fd
5-
6-
# Register _fd completions for fdfind
3+
autoload -Uz _fd
74
compdef _fd fdfind

contrib/completion/fdfind.bash

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
# Source fd completions
22
source /usr/share/bash-completion/completions/fd
33

4-
# Complete with same options as fd
5-
eval "$(complete -p fd | sed 's/ fd$/ fdfind/')"
6-
# Or
7-
#if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
8-
# complete -F _fd -o nosort -o bashdefault -o default fdfind
9-
#else
10-
# complete -F _fd -o bashdefault -o default fdfind
11-
#fi
4+
if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
5+
complete -F _fd -o nosort -o bashdefault -o default fdfind
6+
else
7+
complete -F _fd -o bashdefault -o default fdfind
8+
fi

0 commit comments

Comments
 (0)