/bash_completion.d/ncftp

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

  1. # bash completion for ncftp
  2. have ncftp &&
  3. _ncftp()
  4. {
  5. local cur
  6. COMPREPLY=()
  7. cur=`_get_cword`
  8. if [ $COMP_CWORD -eq 1 ] && [ -f ~/.ncftp/bookmarks ]; then
  9. COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \
  10. ~/.ncftp/bookmarks )' -- "$cur" ) )
  11. fi
  12. return 0
  13. } &&
  14. complete -F _ncftp $default ncftp
  15. # Local variables:
  16. # mode: shell-script
  17. # sh-basic-offset: 4
  18. # sh-indent-comment: t
  19. # indent-tabs-mode: nil
  20. # End:
  21. # ex: ts=4 sw=4 et filetype=sh