diff options
author | Christoph Anton Mitterer <mail@christoph.anton.mitterer.name> | 2023-10-11 03:54:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 10:54:50 +0900 |
commit | 4feaf31225ad2e22660e575f034822bf343391be (patch) | |
tree | 6258aed40211c101916f08e18e6c2047a5a13418 /shell | |
parent | 391aa148451b6c0a5e17ec2453f35afaba046f1f (diff) |
[bash] bring fzf’s own bash completion up to date (#3471)
* [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>
---------
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/completion.bash | 178 |
1 files changed, 152 insertions, 26 deletions
diff --git a/shell/completion.bash b/shell/completion.bash index 463d7764..2c66b694 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -69,59 +69,185 @@ _fzf_opts_completion() { cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" opts=" + -h --help -x --extended -e --exact + --extended-exact + +x --no-extended + +e --no-exact + -q --query + -f --filter + --literal + --no-literal --algo - -i +i + --scheme + --expect + --no-expect + --enabled --no-phony + --disabled --phony + --tiebreak + --bind + --color + --toggle-sort + -d --delimiter -n --nth --with-nth - -d --delimiter + -s --sort +s --no-sort + --track + --no-track --tac - --tiebreak + --no-tac + -i + +i -m --multi + +m --no-multi + --ansi + --no-ansi --no-mouse - --bind + +c --no-color + +2 --no-256 + --black + --no-black + --bold + --no-bold + --layout + --reverse + --no-reverse --cycle + --no-cycle + --keep-right + --no-keep-right + --hscroll --no-hscroll - --jump-labels - --height - --literal - --reverse - --margin + --hscroll-off + --scroll-off + --filepath-word + --no-filepath-word + --info + --no-info --inline-info + --no-inline-info + --separator + --no-separator + --scrollbar + --no-scrollbar + --jump-labels + -1 --select-1 + +1 --no-select-1 + -0 --exit-0 + +0 --no-exit-0 + --read0 + --no-read0 + --print0 + --no-print0 + --print-query + --no-print-query --prompt --pointer --marker - --header - --header-lines - --ansi - --tabstop - --color - --no-bold + --sync + --no-sync + --async + --no-history --history --history-size + --no-header + --no-header-lines + --header + --header-lines + --header-first + --no-header-first + --ellipsis --preview + --no-preview --preview-window - -q --query - -1 --select-1 - -0 --exit-0 - -f --filter - --print-query - --expect - --sync" + --height + --min-height + --no-height + --no-margin + --no-padding + --no-border + --border + --no-border-label + --border-label + --border-label-pos + --no-preview-label + --preview-label + --preview-label-pos + --no-unicode + --unicode + --margin + --padding + --tabstop + --listen + --no-listen + --clear + --no-clear + --version + --" case "${prev}" in + --algo) + COMPREPLY=( $(compgen -W "v1 v2" -- "$cur") ) + return 0 + ;; + --scheme) + COMPREPLY=( $(compgen -W "default path history" -- "$cur") ) + return 0 + ;; --tiebreak) - COMPREPLY=( $(compgen -W "length begin end index" -- "$cur") ) + COMPREPLY=( $(compgen -W "length chunk begin end index" -- "$cur") ) return 0 ;; --color) - COMPREPLY=( $(compgen -W "dark light 16 bw" -- "$cur") ) + COMPREPLY=( $(compgen -W "dark light 16 bw no" -- "$cur") ) + return 0 + ;; + --layout) + COMPREPLY=( $(compgen -W "default reverse reverse-list" -- "$cur") ) + return 0 + ;; + --info) + COMPREPLY=( $(compgen -W "default right hidden inline inline-right" -- "$cur") ) + return 0 + ;; + --preview-window) + COMPREPLY=( $(compgen -W " + default + hidden + nohidden + wrap + nowrap + cycle + nocycle + up top + down bottom + left + right + rounded border border-rounded + sharp border-sharp + border-bold + border-block + border-thinblock + border-double + noborder border-none + border-horizontal + border-vertical + border-up border-top + border-down border-bottom + border-left + border-right + follow + nofollow" -- "$cur") ) + return 0 + ;; + --border) + COMPREPLY=( $(compgen -W "rounded sharp bold block thinblock double horizontal vertical top bottom left right none" -- "$cur") ) return 0 ;; - --history) - COMPREPLY=() + --border-label-pos|--preview-label-pos) + COMPREPLY=( $(compgen -W "center bottom top" -- "$cur") ) return 0 ;; esac |