split lftp completion

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

View File

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

21
contrib/lftp 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 lftp
have lftp &&
_lftp()
{
local cur
COMPREPLY=()
cur=`_get_cword`
if [ $COMP_CWORD -eq 1 ] && [ -f ~/.lftp/bookmarks ]; then
COMPREPLY=( $( compgen -W '$( sed -ne "s/^\(.*\)'$'\t''.*$/\1/p" \
~/.lftp/bookmarks )' -- $cur ) )
fi
return 0
} &&
complete -F _lftp $default lftp