/bash_completion_lib/complete/ipsec

http://github.com/brinkman83/bashrc · #! · 47 lines · 37 code · 10 blank · 0 comment · 0 complexity · ad578af0f3223d5f514a28f497fd8804 MD5 · raw file

  1. # Linux ipsec(8) completion (for FreeS/WAN)
  2. comp_include _get_cword
  3. _ipsec()
  4. {
  5. local cur
  6. COMPREPLY=()
  7. cur=`_get_cword`
  8. if [ $COMP_CWORD -eq 1 ]; then
  9. COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look \
  10. manual pluto ranbits rsasigkey \
  11. setup showdefaults showhostkey spi \
  12. spigrp tncfg whack' -- $cur ) )
  13. return 0
  14. fi
  15. case ${COMP_WORDS[1]} in
  16. auto)
  17. COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \
  18. --replace --down --route --unroute \
  19. --ready --status --rereadsecrets' \
  20. -- $cur ) )
  21. ;;
  22. manual)
  23. COMPREPLY=( $( compgen -W '--up --down --route --unroute \
  24. --union' -- $cur ) )
  25. ;;
  26. ranbits)
  27. COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \
  28. -- $cur ) )
  29. ;;
  30. setup)
  31. COMPREPLY=( $( compgen -W '--start --stop --restart' -- $cur ) )
  32. ;;
  33. *)
  34. ;;
  35. esac
  36. return 0
  37. } # _ipsec()