2009-05-17 22:04:53 +02:00
|
|
|
# bash completion for lftp
|
|
|
|
|
|
|
|
have lftp &&
|
|
|
|
_lftp()
|
|
|
|
{
|
2009-10-20 09:38:33 +03:00
|
|
|
local cur prev
|
2009-05-17 22:04:53 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=()
|
|
|
|
cur=`_get_cword`
|
2009-10-20 09:38:33 +03:00
|
|
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
2009-05-17 22:04:53 +02:00
|
|
|
|
2009-12-30 00:39:59 +01:00
|
|
|
case $prev in
|
2009-10-20 09:38:33 +03:00
|
|
|
-f)
|
|
|
|
_filedir
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-c|-h|--help|-v|--version|-e|-u|-p)
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "$cur" == -* ]] ; then
|
|
|
|
COMPREPLY=( $( compgen -W '-f -c --help --version -e -u -p' \
|
|
|
|
-- "$cur" ) )
|
|
|
|
return 0
|
2009-10-04 19:42:50 +02:00
|
|
|
fi
|
2009-05-17 22:04:53 +02:00
|
|
|
|
2009-10-20 09:38:33 +03:00
|
|
|
COMPREPLY=( $( compgen -W \
|
|
|
|
'$( cut -f 1 -s ~/.lftp/bookmarks 2>/dev/null )' -- "$cur" ) )
|
|
|
|
_known_hosts_real "$cur"
|
2009-05-17 22:04:53 +02:00
|
|
|
} &&
|
2009-10-22 12:04:29 +03:00
|
|
|
complete -F _lftp -o filenames lftp
|
2009-10-20 09:32:59 +03:00
|
|
|
have lftpget &&
|
|
|
|
_lftpget()
|
|
|
|
{
|
|
|
|
COMPREPLY=()
|
|
|
|
local cur=`_get_cword`
|
|
|
|
|
|
|
|
if [[ "$cur" == -* ]] ; then
|
|
|
|
COMPREPLY=( $( compgen -W '-c -d -v' -- "$cur" ) )
|
|
|
|
fi
|
|
|
|
} &&
|
|
|
|
complete -F _lftpget lftpget
|
|
|
|
|
2009-10-01 20:54:51 +03:00
|
|
|
# Local variables:
|
|
|
|
# mode: shell-script
|
2009-10-04 19:42:50 +02:00
|
|
|
# sh-basic-offset: 4
|
2009-10-01 20:54:51 +03:00
|
|
|
# sh-indent-comment: t
|
2009-10-04 19:42:50 +02:00
|
|
|
# indent-tabs-mode: nil
|
2009-10-01 20:54:51 +03:00
|
|
|
# End:
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|