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.

37 lines
1.4 KiB

  1. _ss_server()
  2. {
  3. local cur prev opts ciphers
  4. opts='-s -p -l -k -m -a -f -t -c -n -i -b -u -U -6 -d -v -h --reuse-port --fast-open --acl --manager-address --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. COMPREPLY=()
  7. cur=${COMP_WORDS[COMP_CWORD]}
  8. prev="${COMP_WORDS[COMP_CWORD-1]}"
  9. case "$prev" in
  10. -f|-c|--acl)
  11. _filedir || COMPREPLY=( $(compgen -o plusdirs -f ${cur}) )
  12. ;;
  13. -s|-b)
  14. _known_hosts_real -- "${cur}" || OMPREPLY=( $(compgen -A hostname -- ${cur}) )
  15. ;;
  16. -m)
  17. COMPREPLY=( $(compgen -W "$ciphers" -- ${cur}) )
  18. ;;
  19. -a)
  20. _allowed_users || COMPREPLY=( $(compgen -u -- ${cur}) )
  21. ;;
  22. -p|-l|-k|-t|-n|-d|--mtu|--key|--plugin|--plugin-opts)
  23. ;;
  24. --manager-address)
  25. _known_hosts_real -- "${cur}" || OMPREPLY=( $(compgen -A hostname -- ${cur}) )
  26. _filedir || COMPREPLY+=( $(compgen -o plusdirs -f ${cur}) )
  27. ;;
  28. -i)
  29. _available_interfaces -a || true
  30. ;;
  31. *)
  32. COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
  33. ;;
  34. esac
  35. }
  36. complete -F _ss_server ss-server