split ncftp completion

This commit is contained in:
Guillaume Rousse 2009-05-17 22:04:05 +02:00
parent abaec12fb6
commit aeaa1af920
2 changed files with 21 additions and 19 deletions

View File

@ -3988,25 +3988,6 @@ _lftp()
} &&
complete -F _lftp $default lftp
# ncftp(1) bookmark completion
#
have ncftp &&
_ncftp()
{
local cur
COMPREPLY=()
cur=`_get_cword`
if [ $COMP_CWORD -eq 1 ] && [ -f ~/.ncftp/bookmarks ]; then
COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \
~/.ncftp/bookmarks )' -- $cur ) )
fi
return 0
} &&
complete -F _ncftp $default ncftp
# gdb(1) completion
#
have gdb &&

21
contrib/ncftp Normal file
View File

@ -0,0 +1,21 @@
# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
# ex: ts=8 sw=8 noet filetype=sh
#
# bash completion for ncftp
have ncftp &&
_ncftp()
{
local cur
COMPREPLY=()
cur=`_get_cword`
if [ $COMP_CWORD -eq 1 ] && [ -f ~/.ncftp/bookmarks ]; then
COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \
~/.ncftp/bookmarks )' -- $cur ) )
fi
return 0
} &&
complete -F _ncftp $default ncftp