/bash_completion_lib/complete/filesnarf

http://github.com/brinkman83/bashrc · #! · 29 lines · 20 code · 9 blank · 0 comment · 0 complexity · 44dc0441308372a0f3c48e5f5f6dc35b MD5 · raw file

  1. # filesnarf(8), mailsnarf(8) and msgsnarf (8) completion
  2. comp_include _get_cword
  3. _snarf()
  4. {
  5. local cur
  6. COMPREPLY=()
  7. cur=`_get_cword`
  8. prev=${COMP_WORDS[COMP_CWORD-1]}
  9. case "$prev" in
  10. -i)
  11. _interfaces
  12. return 0
  13. ;;
  14. esac
  15. if [[ "$cur" == -* ]]; then
  16. COMPREPLY=( $( compgen -W '-i -v' -- $cur ) )
  17. fi
  18. } # _snarf()
  19. comp_install -F _snarf # Make completion persistent for subsequent invocations
  20. _snarf # Generate completions for first invocation