bash-completion workaround for bash 3.2

This should resolve mobile-shell/mosh#675
This commit is contained in:
HIGUCHI Yuta
2016-03-11 10:14:51 -08:00
committed by John Hood
parent b275bdc5da
commit 6075209038
+12 -1
View File
@@ -1,8 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
__mosh_init_completion()
{
if declare -F _init_completions >/dev/null 2>&1; then
_init_completion
else
COMPREPLY=()
_get_comp_words_by_ref cur prev words cword
fi
}
_mosh () { _mosh () {
local cur local cur
_init_completion || return
__mosh_init_completion || return
local simple_flags="-a -b -4 -6 -p" local simple_flags="-a -b -4 -6 -p"
local flags="--client= --server= --predict= --family= --port= local flags="--client= --server= --predict= --family= --port=