Skip to content
Myr

completion.bash

This file

Path

shell/completion.bash

571 lines · 15.8 KiB · Shell

Last changed by

[bash] Add code to the default list of programs to support completionJunegunn Choibefore adoption6cbde81

History of this file

Take it

The walk stopped after 200 commits: lines older than f39ae0e point at it.

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

lines 1–6why, one step back
1# ____ ____
2# / __/___ / __/3# / /_/_ / / /_4# / __/ / /_/ __/5# /_/ /___/_/ completion.bash6#

[shell] Add $FZF_COMPLETION_{DIR,PATH}_OPTSJunegunn Choibefore adoptioncd8d736

lines 7–12why, one step back
7# - $FZF_TMUX (default: 0)
8# - $FZF_TMUX_OPTS (default: empty)9# - $FZF_COMPLETION_TRIGGER (default: '**')10# - $FZF_COMPLETION_OPTS (default: empty)11# - $FZF_COMPLETION_PATH_OPTS (default: empty)12# - $FZF_COMPLETION_DIR_OPTS (default: empty)

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

lines 13–103why, one step back
13
14if [[ $- =~ i ]]; then151617# To use custom commands instead of find, override _fzf_compgen_{path,dir}18#19# _fzf_compgen_path() {20# echo "$1"21# command find -L "$1" \22# -name .git -prune -o -name .hg -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \23# -a -not -path "$1" -print 2> /dev/null | command sed 's@^\./@@'24# }25#26# _fzf_compgen_dir() {27# command find -L "$1" \28# -name .git -prune -o -name .hg -prune -o -name .svn -prune -o -type d \29# -a -not -path "$1" -print 2> /dev/null | command sed 's@^\./@@'30# }3132###########################################################3334# To redraw line after fzf closes (printf '\e[5n')35bind '"\e[0n": redraw-current-line' 2> /dev/null3637__fzf_defaults() {38 # $1: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS39 # $2: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS40 echo "--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore $1"41 command cat "${FZF_DEFAULT_OPTS_FILE-}" 2> /dev/null42 echo "${FZF_DEFAULT_OPTS-} $2"43}4445__fzf_comprun() {46 if [[ "$(type -t _fzf_comprun 2>&1)" = function ]]; then47 _fzf_comprun "$@"48 elif [[ -n "${TMUX_PANE-}" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "${FZF_TMUX_OPTS-}" ]]; }; then49 shift50 fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- "$@"51 else52 shift53 fzf "$@"54 fi55}5657__fzf_orig_completion() {58 local l comp f cmd59 while read -r l; do60 if [[ "$l" =~ ^(.*\ -F)\ *([^ ]*).*\ ([^ ]*)$ ]]; then61 comp="${BASH_REMATCH[1]}"62 f="${BASH_REMATCH[2]}"63 cmd="${BASH_REMATCH[3]}"64 [[ "$f" = _fzf_* ]] && continue65 printf -v "_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}" "%s" "${comp} %s ${cmd} #${f}"66 if [[ "$l" = *" -o nospace "* ]] && [[ ! "${__fzf_nospace_commands-}" = *" $cmd "* ]]; then67 __fzf_nospace_commands="${__fzf_nospace_commands-} $cmd "68 fi69 fi70 done71}7273# @param $1 cmd - Command name for which the original completion is searched74# @var[out] REPLY - Original function name is returned75__fzf_orig_completion_get_orig_func() {76 local cmd orig_var orig77 cmd=$178 orig_var="_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}"79 orig="${!orig_var-}"80 REPLY="${orig##*#}"81 [[ $REPLY ]] && type "$REPLY" &> /dev/null82}8384# @param $1 cmd - Command name for which the original completion is searched85# @param $2 func - Fzf's completion function to replace the original function86# @var[out] REPLY - Completion setting is returned as a string to "eval"87__fzf_orig_completion_instantiate() {88 local cmd func orig_var orig89 cmd=$190 func=$291 orig_var="_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}"92 orig="${!orig_var-}"93 orig="${orig%#*}"94 [[ $orig == *' %s '* ]] || return 195 printf -v REPLY "$orig" "$func"96}9798_fzf_opts_completion() {99 local cur prev opts100 COMPREPLY=()101 cur="${COMP_WORDS[COMP_CWORD]}"102 prev="${COMP_WORDS[COMP_CWORD-1]}"103 opts="

Add new options to bash completionJunegunn Choibefore adoption4c83d85

lines 104–106why, one step back
104 +c --no-color
105 +i --no-ignore-case106 +s --no-sort

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

line 107why, one step back
107 +x --no-extended

Add new options to bash completionJunegunn Choibefore adoption4c83d85

lines 108–109why, one step back
108 --ansi
109 --bash

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

line 110why, one step back
110 --bind

Add new options to bash completionJunegunn Choibefore adoption4c83d85

lines 111–113why, one step back
111 --border
112 --border-label113 --border-label-pos

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

lines 114–115why, one step back
114 --color
115 --cycle

Add new options to bash completionJunegunn Choibefore adoption4c83d85

lines 116–118why, one step back
116 --disabled
117 --ellipsis118 --expect

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

line 119why, one step back
119 --filepath-word

Add new options to bash completionJunegunn Choibefore adoption4c83d85

line 120why, one step back
120 --fish

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

lines 121–122why, one step back
121 --header
122 --header-first

Add new options to bash completionJunegunn Choibefore adoption4c83d85

line 123why, one step back
123 --header-lines

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

line 124why, one step back
124 --height

Add new options to bash completionJunegunn Choibefore adoption4c83d85

lines 125–138why, one step back
125 --highlight-line
126 --history127 --history-size128 --hscroll-off129 --info130 --jump-labels131 --keep-right132 --layout133 --listen134 --listen-unsafe135 --literal136 --man137 --margin138 --marker

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

line 139why, one step back
139 --min-height

Add new options to bash completionJunegunn Choibefore adoption4c83d85

lines 140–145why, one step back
140 --no-bold
141 --no-clear142 --no-hscroll143 --no-mouse144 --no-scrollbar145 --no-separator

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

lines 146–147why, one step back
146 --no-unicode
147 --padding

Add new options to bash completionJunegunn Choibefore adoption4c83d85

lines 148–161why, one step back
148 --pointer
149 --preview150 --preview-label151 --preview-label-pos152 --preview-window153 --print-query154 --print0155 --prompt156 --read0157 --reverse158 --scheme159 --scroll-off160 --separator161 --sync

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

line 162why, one step back
162 --tabstop

Add new options to bash completionJunegunn Choibefore adoption4c83d85

lines 163–166why, one step back
163 --tac
164 --tiebreak165 --tmux166 --track

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

line 167why, one step back
167 --version

Add new options to bash completionJunegunn Choibefore adoption4c83d85

lines 168–169why, one step back
168 --with-nth
169 --with-shell

[completion] Use --wrap option in process completionJunegunn Choibefore adoptionb44ab9e

line 170why, one step back
170 --wrap

Add new options to bash completionJunegunn Choibefore adoption4c83d85

lines 171–181why, one step back
171 --zsh
172 -0 --exit-0173 -1 --select-1174 -d --delimiter175 -e --exact176 -f --filter177 -h --help178 -i --ignore-case179 -m --multi180 -n --nth181 -q --query

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

lines 182–310why, one step back
182 --"
183184 case "${prev}" in185 --scheme)186 COMPREPLY=( $(compgen -W "default path history" -- "$cur") )187 return 0188 ;;189 --tiebreak)190 COMPREPLY=( $(compgen -W "length chunk begin end index" -- "$cur") )191 return 0192 ;;193 --color)194 COMPREPLY=( $(compgen -W "dark light 16 bw no" -- "$cur") )195 return 0196 ;;197 --layout)198 COMPREPLY=( $(compgen -W "default reverse reverse-list" -- "$cur") )199 return 0200 ;;201 --info)202 COMPREPLY=( $(compgen -W "default right hidden inline inline-right" -- "$cur") )203 return 0204 ;;205 --preview-window)206 COMPREPLY=( $(compgen -W "207 default208 hidden209 nohidden210 wrap211 nowrap212 cycle213 nocycle214 up top215 down bottom216 left217 right218 rounded border border-rounded219 sharp border-sharp220 border-bold221 border-block222 border-thinblock223 border-double224 noborder border-none225 border-horizontal226 border-vertical227 border-up border-top228 border-down border-bottom229 border-left230 border-right231 follow232 nofollow" -- "$cur") )233 return 0234 ;;235 --border)236 COMPREPLY=( $(compgen -W "rounded sharp bold block thinblock double horizontal vertical top bottom left right none" -- "$cur") )237 return 0238 ;;239 --border-label-pos|--preview-label-pos)240 COMPREPLY=( $(compgen -W "center bottom top" -- "$cur") )241 return 0242 ;;243 esac244245 if [[ "$cur" =~ ^-|\+ ]]; then246 COMPREPLY=( $(compgen -W "${opts}" -- "$cur") )247 return 0248 fi249250 return 0251}252253_fzf_handle_dynamic_completion() {254 local cmd ret REPLY orig_cmd orig_complete255 cmd="$1"256 shift257 orig_cmd="$1"258 if __fzf_orig_completion_get_orig_func "$cmd"; then259 "$REPLY" "$@"260 elif [[ -n "${_fzf_completion_loader-}" ]]; then261 orig_complete=$(complete -p "$orig_cmd" 2> /dev/null)262 $_fzf_completion_loader "$@"263 ret=$?264 # _completion_loader may not have updated completion for the command265 if [[ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]]; then266 __fzf_orig_completion < <(complete -p "$orig_cmd" 2> /dev/null)267268 # Update orig_complete by _fzf_orig_completion entry269 [[ $orig_complete =~ ' -F '(_fzf_[^ ]+)' ' ]] &&270 __fzf_orig_completion_instantiate "$cmd" "${BASH_REMATCH[1]}" &&271 orig_complete=$REPLY272273 if [[ "${__fzf_nospace_commands-}" = *" $orig_cmd "* ]]; then274 eval "${orig_complete/ -F / -o nospace -F }"275 else276 eval "$orig_complete"277 fi278 fi279 [[ $ret -eq 0 ]] && return 124280 return $ret281 fi282}283284__fzf_generic_path_completion() {285 local cur base dir leftover matches trigger cmd286 cmd="${COMP_WORDS[0]}"287 if [[ $cmd == \\* ]]; then288 cmd="${cmd:1}"289 fi290 COMPREPLY=()291 trigger=${FZF_COMPLETION_TRIGGER-'**'}292 cur="${COMP_WORDS[COMP_CWORD]}"293 if [[ "$cur" == *"$trigger" ]] && [[ $cur != *'$('* ]] && [[ $cur != *':='* ]] && [[ $cur != *'`'* ]]; then294 base=${cur:0:${#cur}-${#trigger}}295 eval "base=$base" 2> /dev/null || return296297 dir=298 [[ $base = *"/"* ]] && dir="$base"299 while true; do300 if [[ -z "$dir" ]] || [[ -d "$dir" ]]; then301 leftover=${base/#"$dir"}302 leftover=${leftover/#\/}303 [[ -z "$dir" ]] && dir='.'304 [[ "$dir" != "/" ]] && dir="${dir/%\//}"305 matches=$(306 export FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --scheme=path" "${FZF_COMPLETION_OPTS-} $2")307 unset FZF_DEFAULT_COMMAND FZF_DEFAULT_OPTS_FILE308 if declare -F "$1" > /dev/null; then309 eval "$1 $(printf %q "$dir")" | __fzf_comprun "$4" -q "$leftover"310 else

[shell] Add $FZF_COMPLETION_{DIR,PATH}_OPTSJunegunn Choibefore adoptioncd8d736

lines 311–318why, one step back
311 if [[ $1 =~ dir ]]; then
312 walker=dir,follow313 rest=${FZF_COMPLETION_DIR_OPTS-}314 else315 walker=file,dir,follow,hidden316 rest=${FZF_COMPLETION_PATH_OPTS-}317 fi318 __fzf_comprun "$4" -q "$leftover" --walker "$walker" --walker-root="$dir" $rest

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

lines 319–410why, one step back
319 fi | while read -r item; do
320 printf "%q " "${item%$3}$3"321 done322 )323 matches=${matches% }324 [[ -z "$3" ]] && [[ "${__fzf_nospace_commands-}" = *" ${COMP_WORDS[0]} "* ]] && matches="$matches "325 if [[ -n "$matches" ]]; then326 COMPREPLY=( "$matches" )327 else328 COMPREPLY=( "$cur" )329 fi330 printf '\e[5n'331 return 0332 fi333 dir=$(command dirname "$dir")334 [[ "$dir" =~ /$ ]] || dir="$dir"/335 done336 else337 shift338 shift339 shift340 _fzf_handle_dynamic_completion "$cmd" "$@"341 fi342}343344_fzf_complete() {345 # Split arguments around --346 local args rest str_arg i sep347 args=("$@")348 sep=349 for i in "${!args[@]}"; do350 if [[ "${args[$i]}" = -- ]]; then351 sep=$i352 break353 fi354 done355 if [[ -n "$sep" ]]; then356 str_arg=357 rest=("${args[@]:$((sep + 1)):${#args[@]}}")358 args=("${args[@]:0:$sep}")359 else360 str_arg=$1361 args=()362 shift363 rest=("$@")364 fi365366 local cur selected trigger cmd post367 post="$(caller 0 | command awk '{print $2}')_post"368 type -t "$post" > /dev/null 2>&1 || post='command cat'369370 trigger=${FZF_COMPLETION_TRIGGER-'**'}371 cmd="${COMP_WORDS[0]}"372 cur="${COMP_WORDS[COMP_CWORD]}"373 if [[ "$cur" == *"$trigger" ]] && [[ $cur != *'$('* ]] && [[ $cur != *':='* ]] && [[ $cur != *'`'* ]]; then374 cur=${cur:0:${#cur}-${#trigger}}375376 selected=$(377 FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse" "${FZF_COMPLETION_OPTS-} $str_arg") \378 FZF_DEFAULT_OPTS_FILE='' \379 __fzf_comprun "${rest[0]}" "${args[@]}" -q "$cur" | $post | command tr '\n' ' ')380 selected=${selected% } # Strip trailing space not to repeat "-o nospace"381 if [[ -n "$selected" ]]; then382 COMPREPLY=("$selected")383 else384 COMPREPLY=("$cur")385 fi386 printf '\e[5n'387 return 0388 else389 _fzf_handle_dynamic_completion "$cmd" "${rest[@]}"390 fi391}392393_fzf_path_completion() {394 __fzf_generic_path_completion _fzf_compgen_path "-m" "" "$@"395}396397# Deprecated. No file only completion.398_fzf_file_completion() {399 _fzf_path_completion "$@"400}401402_fzf_dir_completion() {403 __fzf_generic_path_completion _fzf_compgen_dir "" "/" "$@"404}405406_fzf_complete_kill() {407 _fzf_proc_completion "$@"408}409410_fzf_proc_completion() {

[completion] Use --wrap option in process completionJunegunn Choibefore adoptionb44ab9e

line 411why, one step back
411 _fzf_complete -m --header-lines=1 --no-preview --wrap -- "$@" < <(

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

lines 412–487why, one step back
412 command ps -eo user,pid,ppid,start,time,command 2> /dev/null ||
413 command ps -eo user,pid,ppid,time,args # For BusyBox414 )415}416417_fzf_proc_completion_post() {418 command awk '{print $2}'419}420421# To use custom hostname lists, override __fzf_list_hosts.422# The function is expected to print hostnames, one per line as well as in the423# desired sorting and with any duplicates removed, to standard output.424#425# e.g.426# # Use bash-completions’s _known_hosts_real() for getting the list of hosts427# __fzf_list_hosts() {428# # Set the local attribute for any non-local variable that is set by _known_hosts_real()429# local COMPREPLY=()430# _known_hosts_real ''431# printf '%s\n' "${COMPREPLY[@]}" | command sort -u --version-sort432# }433if ! declare -F __fzf_list_hosts > /dev/null; then434 __fzf_list_hosts() {435 command cat <(command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2> /dev/null | command grep -i '^\s*host\(name\)\? ' | command awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' | command grep -v '[*?%]') \436 <(command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts 2> /dev/null | command tr ',' '\n' | command tr -d '[' | command awk '{ print $1 " " $1 }') \437 <(command grep -v '^\s*\(#\|$\)' /etc/hosts 2> /dev/null | command grep -Fv '0.0.0.0' | command sed 's/#.*//') |438 command awk '{for (i = 2; i <= NF; i++) print $i}' | command sort -u439 }440fi441442_fzf_host_completion() {443 _fzf_complete +m -- "$@" < <(__fzf_list_hosts)444}445446# Values for $1 $2 $3 are described here447# https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html448# > the first argument ($1) is the name of the command whose arguments are being completed,449# > the second argument ($2) is the word being completed,450# > and the third argument ($3) is the word preceding the word being completed on the current command line.451_fzf_complete_ssh() {452 case $3 in453 -i|-F|-E)454 _fzf_path_completion "$@"455 ;;456 *)457 local user=458 [[ "$2" =~ '@' ]] && user="${2%%@*}@"459 _fzf_complete +m -- "$@" < <(__fzf_list_hosts | command awk -v user="$user" '{print user $0}')460 ;;461 esac462}463464_fzf_var_completion() {465 _fzf_complete -m -- "$@" < <(466 declare -xp | command sed -En 's|^declare [^ ]+ ([^=]+).*|\1|p'467 )468}469470_fzf_alias_completion() {471 _fzf_complete -m -- "$@" < <(472 alias | command sed -En 's|^alias ([^=]+).*|\1|p'473 )474}475476# fzf options477complete -o default -F _fzf_opts_completion fzf478# fzf-tmux is a thin fzf wrapper that has only a few more options than fzf479# itself. As a quick improvement we take fzf's completion. Adding the few extra480# fzf-tmux specific options (like `-w WIDTH`) are left as a future patch.481complete -o default -F _fzf_opts_completion fzf-tmux482483d_cmds="${FZF_COMPLETION_DIR_COMMANDS-cd pushd rmdir}"484485# NOTE: $FZF_COMPLETION_PATH_COMMANDS and $FZF_COMPLETION_VAR_COMMANDS are486# undocumented and subject to change in the future.487a_cmds="${FZF_COMPLETION_PATH_COMMANDS-"

[bash] Add code to the default list of programs to support completionJunegunn Choibefore adoption6cbde81

line 488why, one step back
488 awk bat cat code diff diff3

Deploying to master from @ junegunn/fzf@4a68eac99bb3814f912d236fa9356516ebda2fa5 🚀junegunnbefore adoptionf39ae0e

lines 489–571why, one step back
489 emacs emacsclient ex file ftp g++ gcc gvim head hg hx java
490 javac ld less more mvim nvim patch perl python ruby491 sed sftp sort source tail tee uniq vi view vim wc xdg-open492 basename bunzip2 bzip2 chmod chown curl cp dirname du493 find git grep gunzip gzip hg jar494 ln ls mv open rm rsync scp495 svn tar unzip zip"}"496v_cmds="${FZF_COMPLETION_VAR_COMMANDS-export unset printenv}"497498# Preserve existing completion499__fzf_orig_completion < <(complete -p $d_cmds $a_cmds $v_cmds unalias kill ssh 2> /dev/null)500501if type _comp_load > /dev/null 2>&1; then502 # _comp_load was added in bash-completion 2.12 to replace _completion_loader.503 # We use it without -D option so that it does not use _comp_complete_minimal as the fallback.504 _fzf_completion_loader=_comp_load505elif type __load_completion > /dev/null 2>&1; then506 # In bash-completion 2.11, _completion_loader internally calls __load_completion507 # and if it returns a non-zero status, it sets the default 'minimal' completion.508 _fzf_completion_loader=__load_completion509elif type _completion_loader > /dev/null 2>&1; then510 _fzf_completion_loader=_completion_loader511fi512513__fzf_defc() {514 local cmd func opts REPLY515 cmd="$1"516 func="$2"517 opts="$3"518 if __fzf_orig_completion_instantiate "$cmd" "$func"; then519 eval "$REPLY"520 else521 complete -F "$func" $opts "$cmd"522 fi523}524525# Anything526for cmd in $a_cmds; do527 __fzf_defc "$cmd" _fzf_path_completion "-o default -o bashdefault"528done529530# Directory531for cmd in $d_cmds; do532 __fzf_defc "$cmd" _fzf_dir_completion "-o bashdefault -o nospace -o dirnames"533done534535# Variables536for cmd in $v_cmds; do537 __fzf_defc "$cmd" _fzf_var_completion "-o default -o nospace -v"538done539540# Aliases541__fzf_defc unalias _fzf_alias_completion "-a"542543# Processes544__fzf_defc kill _fzf_proc_completion "-o default -o bashdefault"545546# ssh547__fzf_defc ssh _fzf_complete_ssh "-o default -o bashdefault"548549unset cmd d_cmds a_cmds v_cmds550551_fzf_setup_completion() {552 local kind fn cmd553 kind=$1554 fn=_fzf_${1}_completion555 if [[ $# -lt 2 ]] || ! type -t "$fn" > /dev/null; then556 echo "usage: ${FUNCNAME[0]} path|dir|var|alias|host|proc COMMANDS..."557 return 1558 fi559 shift560 __fzf_orig_completion < <(complete -p "$@" 2> /dev/null)561 for cmd in "$@"; do562 case "$kind" in563 dir) __fzf_defc "$cmd" "$fn" "-o nospace -o dirnames" ;;564 var) __fzf_defc "$cmd" "$fn" "-o default -o nospace -v" ;;565 alias) __fzf_defc "$cmd" "$fn" "-a" ;;566 *) __fzf_defc "$cmd" "$fn" "-o default -o bashdefault" ;;567 esac568 done569}570571fi