Skip to content
Myr

[bash] bring fzf’s own bash completion up to date (#3471)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* [bash] bring fzf’s own bash completion up to date This orders and groups completed options and values in just as they appear in the code respectively, for some option values, as they’d be printed in the `--help`-output. It does not add support for completion of `:` right after values that support an optional `:some-further-value` postfix. Neither does it add support for the `--option=value`-style. Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name> * [bash] drop unnecessary code in handling `history` Presumably, the dropped code is not needed for any effect, thus drop it. Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name> ---------

authored by Christoph Anton Mitterer · committed by GitHub · parent 391aa14 · Browse files · 1 file+152 added−26 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>

Diff stats

1 file+152 added−26 removed

  • other:+152 added−26 removed

1 file+152 added−26 removed

modified:shell/completion.bash+152 added-26 removed
67 unmodified lines
68 COMPREPLY=()69 cur="${COMP_WORDS[COMP_CWORD]}"70 prev="${COMP_WORDS[COMP_CWORD-1]}"71 opts="72 -h --help73 -x --extended74 -e --exact75 --extended-exact76 +x --no-extended77 +e --no-exact78 -q --query79 -f --filter80 --literal81 --no-literal82 --algo75 -i +i83 --scheme84 --expect85 --no-expect86 --enabled --no-phony87 --disabled --phony88 --tiebreak89 --bind90 --color91 --toggle-sort92 -d --delimiter93 -n --nth94 --with-nth78 -d --delimiter95 -s --sort96 +s --no-sort97 --track98 --no-track99 --tac81 --tiebreak100 --no-tac101 -i102 +i103 -m --multi104 +m --no-multi105 --ansi106 --no-ansi107 --no-mouse108 +c --no-color109 +2 --no-256110 --black111 --no-black84 --bind112 --bold113 --no-bold114 --layout115 --reverse116 --no-reverse117 --cycle118 --no-cycle119 --keep-right120 --no-keep-right121 --hscroll122 --no-hscroll87 --jump-labels88 --height89 --literal90 --reverse91 --margin123 --hscroll-off124 --scroll-off125 --filepath-word126 --no-filepath-word127 --info128 --no-info129 --inline-info130 --no-inline-info131 --separator132 --no-separator133 --scrollbar134 --no-scrollbar135 --jump-labels136 -1 --select-1137 +1 --no-select-1138 -0 --exit-0139 +0 --no-exit-0140 --read0141 --no-read0142 --print0143 --no-print0144 --print-query145 --no-print-query146 --prompt147 --pointer148 --marker96 --header97 --header-lines98 --ansi99 --tabstop100 --color101 --no-bold149 --sync150 --no-sync151 --async152 --no-history153 --history154 --history-size155 --no-header156 --no-header-lines157 --header158 --header-lines159 --header-first160 --no-header-first161 --ellipsis162 --preview163 --no-preview164 --preview-window106 -q --query107 -1 --select-1108 -0 --exit-0109 -f --filter110 --print-query111 --expect112 --sync"165 --height166 --min-height167 --no-height168 --no-margin169 --no-padding170 --no-border171 --border172 --no-border-label173 --border-label174 --border-label-pos175 --no-preview-label176 --preview-label177 --preview-label-pos178 --no-unicode179 --unicode180 --margin181 --padding182 --tabstop183 --listen184 --no-listen185 --clear186 --no-clear187 --version188 --"189190 case "${prev}" in191 --algo)192 COMPREPLY=( $(compgen -W "v1 v2" -- "$cur") )193 return 0194 ;;195 --scheme)196 COMPREPLY=( $(compgen -W "default path history" -- "$cur") )197 return 0198 ;;199 --tiebreak)116 COMPREPLY=( $(compgen -W "length begin end index" -- "$cur") )200 COMPREPLY=( $(compgen -W "length chunk begin end index" -- "$cur") )201 return 0202 ;;203 --color)120 COMPREPLY=( $(compgen -W "dark light 16 bw" -- "$cur") )204 COMPREPLY=( $(compgen -W "dark light 16 bw no" -- "$cur") )205 return 0206 ;;123 --history)124 COMPREPLY=()207 --layout)208 COMPREPLY=( $(compgen -W "default reverse reverse-list" -- "$cur") )209 return 0210 ;;211 --info)212 COMPREPLY=( $(compgen -W "default right hidden inline inline-right" -- "$cur") )213 return 0214 ;;215 --preview-window)216 COMPREPLY=( $(compgen -W "217 default218 hidden219 nohidden220 wrap221 nowrap222 cycle223 nocycle224 up top225 down bottom226 left227 right228 rounded border border-rounded229 sharp border-sharp230 border-bold231 border-block232 border-thinblock233 border-double234 noborder border-none235 border-horizontal236 border-vertical237 border-up border-top238 border-down border-bottom239 border-left240 border-right241 follow242 nofollow" -- "$cur") )243 return 0244 ;;245 --border)246 COMPREPLY=( $(compgen -W "rounded sharp bold block thinblock double horizontal vertical top bottom left right none" -- "$cur") )247 return 0248 ;;249 --border-label-pos|--preview-label-pos)250 COMPREPLY=( $(compgen -W "center bottom top" -- "$cur") )251 return 0252 ;;253 esac254255 if [[ "$cur" =~ ^-|\+ ]]; then256 COMPREPLY=( $(compgen -W "${opts}" -- "$cur") )
274 unmodified lines