summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_mosh
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_mosh')
-rw-r--r--Completion/Unix/Command/_mosh23
1 files changed, 19 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_mosh b/Completion/Unix/Command/_mosh
index 431fdbf9e..7d1250320 100644
--- a/Completion/Unix/Command/_mosh
+++ b/Completion/Unix/Command/_mosh
@@ -1,6 +1,6 @@
#compdef mosh
-local curcontext="$curcontext" state line
+local curcontext="$curcontext" state line expl ret=1
local -a _comp_priv_prefix
_arguments -C \
@@ -12,15 +12,30 @@ _arguments -C \
'(-a -n)--predict=[control speculative local echo]:mode:(adaptive always never)' \
'(--predict -n)-a[synonym for --predict=always]' \
'(--predict -a)-n[synonym for --predict=never]' \
+ '(--family -6)-4[use IPv4 only]' \
+ '(--family -4)-6[use IPv6 only]' \
+ '(-4 -6)--family=[specify address family]:family [prefer-inet]:(inet inet6 auto all prefer-inet prefer-inet6)' \
+ '--bind-server=[ask the server to reply from an IP address]:{ssh|any|IP}' \
'--server[specify command to run server helper]:remote file:_files' \
'--client[specify command to run client helper]:_command_names -e' \
+ "--no-ssh-pty[don't allocate a pseudo tty on ssh connection]" \
+ '--local[run mosh-server locally without using ssh]' \
+ '--experimental-remote-ip=[select method for discovering remote IP address to use for mosh]:method:(local remote proxy)' \
'1:remote host name:->userhost' \
- '*:::args:_normal' && return
+ '*:::args:_normal' && ret=0
case $state in
userhost)
- _hosts || _user_at_host && return
+ if compset -P '*@'; then
+ _wanted hosts expl 'remote host name' _ssh_hosts && ret=0
+ elif compset -S '@*'; then
+ _wanted users expl 'login name' _combination -s '[:@]' my-accounts users-hosts users -S '' && ret=0
+ else
+ _alternative \
+ 'hosts:remote host name:_ssh_hosts' \
+ 'users:login name:_combination -s "[:@]" my-accounts users-hosts users -qS@' && ret=0
+ fi
;;
esac
-return 1
+return ret