/bash_completion.d/resolvconf

http://github.com/brinkman83/bashrc · #! · 31 lines · 26 code · 5 blank · 0 comment · 0 complexity · 7192e6ecceac5f4bc9dbc8b51c727c1e MD5 · raw file

  1. # bash completion for resolvconf
  2. have resolvconf &&
  3. _resolvconf()
  4. {
  5. local cur command
  6. COMPREPLY=()
  7. cur=`_get_cword`
  8. prev=${COMP_WORDS[COMP_CWORD-1]}
  9. case $prev in
  10. -@(a|d))
  11. _available_interfaces
  12. return 0
  13. ;;
  14. esac
  15. if [[ "$cur" == -* ]]; then
  16. COMPREPLY=( $( compgen -W '-a -d -u' -- "$cur" ) )
  17. fi
  18. } &&
  19. complete -F _resolvconf resolvconf
  20. # Local variables:
  21. # mode: shell-script
  22. # sh-basic-offset: 4
  23. # sh-indent-comment: t
  24. # indent-tabs-mode: nil
  25. # End:
  26. # ex: ts=4 sw=4 et filetype=sh