/bash_completion.d/links

http://github.com/brinkman83/bashrc · #! · 43 lines · 38 code · 5 blank · 0 comment · 0 complexity · bef896ea47756b137e43ccfdcea4fe25 MD5 · raw file

  1. # bash completion for links
  2. have links &&
  3. _links()
  4. {
  5. local cur
  6. COMPREPLY=()
  7. cur=`_get_cword`
  8. case "$cur" in
  9. --*)
  10. COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
  11. ;;
  12. -*)
  13. COMPREPLY=( $( compgen -W '-async-dns -max-connections \
  14. -max-connections-to-host -retries -receive-timeout \
  15. -unrestartable-receive-timeout -format-cache-size \
  16. -memory-cache-size -http-proxy -ftp-proxy -download-dir \
  17. -assume-codepage -anonymous -dump -no-connect \
  18. -source -version -help' -- "$cur" ) )
  19. ;;
  20. *)
  21. if [ -r ~/.links/links.his ]; then
  22. COMPREPLY=( $( compgen -W '$( < ~/.links/links.his )' \
  23. -- "$cur" ) )
  24. fi
  25. _filedir '@(htm|html)'
  26. return 0
  27. ;;
  28. esac
  29. return 0
  30. } &&
  31. complete -F _links $filenames links
  32. # Local variables:
  33. # mode: shell-script
  34. # sh-basic-offset: 4
  35. # sh-indent-comment: t
  36. # indent-tabs-mode: nil
  37. # End:
  38. # ex: ts=4 sw=4 et filetype=sh