_ss_tunnel() { local cur prev opts ciphers opts='-s -p -l -k -m -a -f -t -c -n -i -b -u -U -L -v -h --reuse-port --mtu --mptcp --key --plugin --plugin-opts --help' ciphers='aes-128-gcm aes-192-gcm aes-256-gcm chacha20-ietf-poly1305 xchacha20-ietf-poly1305 2022-blake3-aes-128-gcm 2022-blake3-aes-256-gcm 2022-blake3-chacha20-poly1305' cur=${COMP_WORDS[COMP_CWORD]} prev="${COMP_WORDS[COMP_CWORD-1]}" compopt +o nospace case "$prev" in -f|-c) _filedir || COMPREPLY=( $(compgen -o plusdirs -f ${cur}) ) ;; -s|-b) _known_hosts_real -- "${cur}" || OMPREPLY=( $(compgen -A hostname -- ${cur}) ) ;; -L) compopt -o nospace _known_hosts_real -c -- "${cur}" || OMPREPLY=( $(compgen -A hostname -S : -- ${cur}) ) ;; -m) COMPREPLY=( $(compgen -W "$ciphers" -- ${cur}) ) ;; -a) _allowed_users || COMPREPLY=( $(compgen -u -- ${cur}) ) ;; -p|-l|-k|-t|-n|--mtu|--key|--plugin|--plugin-opts) ;; -i) _available_interfaces -a || true ;; *) COMPREPLY+=( $(compgen -W "${opts}" -- ${cur}) ) ;; esac return 0 } complete -F _ss_tunnel ss-tunnel