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()
{
compopt +o default +o nospace
# https://github.com/andsens/homeshick/blob/master/completions/homeshick-completion.bash
if $_HOMESHICK_HAS_COMPOPT; then
compopt +o default +o nospace
COMPREPLY=()
else
COMPREPLY=('')
fi
local -r cmds='
app
@ -113,4 +119,11 @@ _abra_complete()
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