Skip to content

Commit

Permalink
updated bash completion
Browse files Browse the repository at this point in the history
  • Loading branch information
sbdchd authored and cgull committed Mar 31, 2016
1 parent c964d40 commit 99ce327
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions conf/bash-completion/completions/mosh
@@ -1,9 +1,18 @@
_mosh () {
local cur prev
#!/bin/bash

_init_completion || return
_mosh () {
local simple_flags="-a -b -4 -6 -p"
local flags="--client= --server= --predict= --family= --port=
--bind-server= --ssh= --no-init --help --version"

_known_hosts_real -a "$cur"
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

0 comments on commit 99ce327

Please sign in to comment.