Handle missing compopt

Ref #5
This commit is contained in:
3wc 2020-10-30 21:40:09 +02:00
parent b226396764
commit 2bdfe8baa8

View File

@ -40,7 +40,13 @@ _abra_complete_apps()
_abra_complete() _abra_complete()
{ {
# https://github.com/andsens/homeshick/blob/master/completions/homeshick-completion.bash
if $_HOMESHICK_HAS_COMPOPT; then
compopt +o default +o nospace compopt +o default +o nospace
COMPREPLY=()
else
COMPREPLY=('')
fi
local -r cmds=' local -r cmds='
app app
@ -113,4 +119,11 @@ _abra_complete()
fi fi
} }
# https://github.com/andsens/homeshick/blob/master/completions/homeshick-completion.bash
if type compopt &>/dev/null; then
_ABRA_HAS_COMPOPT=true
else
_ABRA_HAS_COMPOPT=false
fi
complete -o default -F _abra_complete abra complete -o default -F _abra_complete abra