updated bash completion

This commit is contained in:
Steve Dignam
2016-01-06 23:14:30 -05:00
committed by John Hood
parent c964d40dd8
commit 99ce327d93
+13 -4
View File
@@ -1,9 +1,18 @@
#!/bin/bash
_mosh () {
local cur prev
_init_completion || return
local simple_flags="-a -b -4 -6 -p"
local flags="--client= --server= --predict= --family= --port=
--bind-server= --ssh= --no-init --help --version"
local cur=$(_get_cword)
if [[ "$cur" == --* && "$COMP_CWORD" == 1 ]]; then
COMPREPLY=($(compgen -W "$flags" -- "$cur"))
elif [[ "$cur" == -* && "$COMP_CWORD" == 1 ]]; then
COMPREPLY=($(compgen -W "$simple_flags" -- "$cur"))
else
_known_hosts_real -a "$cur"
fi
}
complete -F _mosh mosh
complete -o nospace -F _mosh mosh