52 lines
1005 B
Plaintext
Raw Normal View History

2009-05-17 22:04:53 +02:00
# bash completion for lftp
have lftp &&
_lftp()
{
local cur prev
2009-05-17 22:04:53 +02:00
2009-10-04 19:42:50 +02:00
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
2009-05-17 22:04:53 +02:00
case $prev in
-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
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
} &&
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
# Local variables:
# mode: shell-script
2009-10-04 19:42:50 +02:00
# sh-basic-offset: 4
# sh-indent-comment: t
2009-10-04 19:42:50 +02:00
# indent-tabs-mode: nil
# End:
2009-10-04 19:42:50 +02:00
# ex: ts=4 sw=4 et filetype=sh