aboutsummaryrefslogtreecommitdiff
path: root/extra/completions/alacritty.bash
diff options
context:
space:
mode:
Diffstat (limited to 'extra/completions/alacritty.bash')
-rw-r--r--extra/completions/alacritty.bash94
1 files changed, 93 insertions, 1 deletions
diff --git a/extra/completions/alacritty.bash b/extra/completions/alacritty.bash
index c1546f50..2c10d47c 100644
--- a/extra/completions/alacritty.bash
+++ b/extra/completions/alacritty.bash
@@ -72,15 +72,48 @@ _alacritty() {
return 0
;;
--config-file)
+ local oldifs
+ if [ -n "${IFS+x}" ]; then
+ oldifs="$IFS"
+ fi
+ IFS=$'\n'
COMPREPLY=($(compgen -f "${cur}"))
+ if [ -n "${oldifs+x}" ]; then
+ IFS="$oldifs"
+ fi
+ if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
+ compopt -o filenames
+ fi
return 0
;;
--socket)
+ local oldifs
+ if [ -n "${IFS+x}" ]; then
+ oldifs="$IFS"
+ fi
+ IFS=$'\n'
COMPREPLY=($(compgen -f "${cur}"))
+ if [ -n "${oldifs+x}" ]; then
+ IFS="$oldifs"
+ fi
+ if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
+ compopt -o filenames
+ fi
return 0
;;
--working-directory)
+ local oldifs
+ if [ -n "${IFS+x}" ]; then
+ oldifs="$IFS"
+ fi
+ IFS=$'\n'
COMPREPLY=($(compgen -f "${cur}"))
+ if [ -n "${oldifs+x}" ]; then
+ IFS="$oldifs"
+ fi
+ if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
+ compopt -o filenames
+ fi
return 0
;;
--command)
@@ -210,11 +243,33 @@ _alacritty() {
fi
case "${prev}" in
--config-file)
+ local oldifs
+ if [ -n "${IFS+x}" ]; then
+ oldifs="$IFS"
+ fi
+ IFS=$'\n'
COMPREPLY=($(compgen -f "${cur}"))
+ if [ -n "${oldifs+x}" ]; then
+ IFS="$oldifs"
+ fi
+ if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
+ compopt -o filenames
+ fi
return 0
;;
-c)
+ local oldifs
+ if [ -n "${IFS+x}" ]; then
+ oldifs="$IFS"
+ fi
+ IFS=$'\n'
COMPREPLY=($(compgen -f "${cur}"))
+ if [ -n "${oldifs+x}" ]; then
+ IFS="$oldifs"
+ fi
+ if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
+ compopt -o filenames
+ fi
return 0
;;
*)
@@ -232,11 +287,33 @@ _alacritty() {
fi
case "${prev}" in
--socket)
+ local oldifs
+ if [ -n "${IFS+x}" ]; then
+ oldifs="$IFS"
+ fi
+ IFS=$'\n'
COMPREPLY=($(compgen -f "${cur}"))
+ if [ -n "${oldifs+x}" ]; then
+ IFS="$oldifs"
+ fi
+ if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
+ compopt -o filenames
+ fi
return 0
;;
-s)
+ local oldifs
+ if [ -n "${IFS+x}" ]; then
+ oldifs="$IFS"
+ fi
+ IFS=$'\n'
COMPREPLY=($(compgen -f "${cur}"))
+ if [ -n "${oldifs+x}" ]; then
+ IFS="$oldifs"
+ fi
+ if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
+ compopt -o filenames
+ fi
return 0
;;
*)
@@ -276,7 +353,18 @@ _alacritty() {
fi
case "${prev}" in
--working-directory)
+ local oldifs
+ if [ -n "${IFS+x}" ]; then
+ oldifs="$IFS"
+ fi
+ IFS=$'\n'
COMPREPLY=($(compgen -f "${cur}"))
+ if [ -n "${oldifs+x}" ]; then
+ IFS="$oldifs"
+ fi
+ if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
+ compopt -o filenames
+ fi
return 0
;;
--command)
@@ -373,4 +461,8 @@ _alacritty() {
esac
}
-complete -F _alacritty -o nosort -o bashdefault -o default alacritty
+if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
+ complete -F _alacritty -o nosort -o bashdefault -o default alacritty
+else
+ complete -F _alacritty -o bashdefault -o default alacritty
+fi