You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.1 KiB

  1. _ss_redir()
  2. {
  3. local cur prev opts ciphers
  4. opts='-s -p -l -k -m -a -f -t -c -n -b -u -U -v -h --reuse-port --mtu --mptcp --key --plugin --plugin-opts --help'
  5. ciphers='rc4-md5 aes-128-gcm aes-192-gcm aes-256-gcm aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr camellia-128-cfb camellia-192-cfb camellia-256-cfb bf-cfb chacha20-ietf-poly1305 salsa20 chacha20 chacha20-ietf'
  6. cur=${COMP_WORDS[COMP_CWORD]}
  7. prev="${COMP_WORDS[COMP_CWORD-1]}"
  8. case "$prev" in
  9. -f|-c)
  10. _filedir || COMPREPLY=( $(compgen -o plusdirs -f ${cur}) )
  11. ;;
  12. -s|-b)
  13. _known_hosts_real -- "${cur}" || OMPREPLY=( $(compgen -A hostname -- ${cur}) )
  14. ;;
  15. -m)
  16. COMPREPLY=( $(compgen -W "$ciphers" -- ${cur}) )
  17. ;;
  18. -a)
  19. _allowed_users || COMPREPLY=( $(compgen -u -- ${cur}) )
  20. ;;
  21. -p|-l|-k|-t|-n|--mtu|--key|--plugin|--plugin-opts)
  22. ;;
  23. *)
  24. COMPREPLY+=( $(compgen -W "${opts}" -- ${cur}) )
  25. ;;
  26. esac
  27. return 0
  28. }
  29. complete -F _ss_redir ss-redir