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.

41 lines
1.5 KiB

  1. _ss_manager()
  2. {
  3. local cur prev opts ciphers
  4. opts='-s -b -p -k -f -t -m -c -a -n -u -U -v -h -A --mtu --help --mptcp -i -l --manager-address --executable'
  5. ciphers='rc4-md5 table rc4 aes-128-cfb aes-192-cfb aes-256-cfb aes-128-ctr aes-192-ctr aes-256-ctr bf-cfb camellia-128-cfb camellia-192-cfb camellia-256-cfb cast5-cfb des-cfb idea-cfb rc2-cfb seed-cfb salsa20 chacha20 and chacha20-ietf'
  6. cur=${COMP_WORDS[COMP_CWORD]}
  7. prev="${COMP_WORDS[COMP_CWORD-1]}"
  8. case "$prev" in
  9. -c|-f|--executable)
  10. _filedir || COMPREPLY=( $(compgen -o plusdirs -f ${cur}) )
  11. ;;
  12. -s|-b)
  13. _known_hosts_real -- "${cur}" || OMPREPLY=( $(compgen -A hostname -- ${cur}) )
  14. ;;
  15. -L)
  16. compopt -o nospace
  17. _known_hosts_real -c -- "${cur}" || OMPREPLY=( $(compgen -A hostname -S : -- ${cur}) )
  18. ;;
  19. -m)
  20. COMPREPLY=( $(compgen -W "$ciphers" -- ${cur}) )
  21. ;;
  22. -a)
  23. _allowed_users || COMPREPLY=( $(compgen -u -- ${cur}) )
  24. ;;
  25. -p|-k|-t|-n|--mtu|-l)
  26. ;;
  27. -i)
  28. _available_interfaces -a || true
  29. ;;
  30. --manager-address)
  31. _known_hosts_real -- "${cur}" || OMPREPLY=( $(compgen -A hostname -- ${cur}) )
  32. _filedir || COMPREPLY+=( $(compgen -o plusdirs -f ${cur}) )
  33. ;;
  34. *)
  35. COMPREPLY+=( $(compgen -W "${opts}" -- ${cur}) )
  36. ;;
  37. esac
  38. return 0
  39. }
  40. complete -F _ss_manager ss-manager