PageRenderTime 224ms CodeModel.GetById 222ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 3have ncftp &&
 4_ncftp()
 5{
 6    local cur
 7
 8    COMPREPLY=()
 9    cur=`_get_cword`
10
11    if [ $COMP_CWORD -eq 1 ] && [ -f ~/.ncftp/bookmarks ]; then
12        COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \
13            ~/.ncftp/bookmarks )' -- "$cur" ) )
14    fi
15
16    return 0
17} &&
18complete -F _ncftp $default ncftp
19
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