ncftp bookmark completion from Markus Dobel <mdobel@kawo2.rwth-aachen.de>

This commit is contained in:
ianmacd 2002-02-10 20:45:46 +00:00
parent 251e972c2f
commit 2dddaf2b23

View File

@ -2,7 +2,7 @@
# #
# <![CDATA[ # <![CDATA[
# #
# $Id: bash_completion,v 1.97 2002/02/10 21:32:39 ianmacd Exp $ # $Id: bash_completion,v 1.98 2002/02/10 21:45:46 ianmacd Exp $
# #
# Copyright (C) Ian Macdonald <ian@caliban.org> # Copyright (C) Ian Macdonald <ian@caliban.org>
# #
@ -1655,6 +1655,23 @@ _screen()
} }
[ $have ] && complete -F _screen -o default screen [ $have ] && complete -F _screen -o default screen
# ncftp(1) bookmark completion
#
have ncftp &&
_ncftp()
{
local cur
cur=${COMP_WORDS[COMP_CWORD]}
if [ $COMP_CWORD = 1 ] && [ -f ~/.ncftp/bookmarks ]; then
COMPREPLY=( $( compgen -W '`cut --output-delimiter " " \
-s -f1-2 -d, ~/.ncftp/bookmarks`' $cur ))
fi
return 0
}
[ $have ] && complete -F _ncftp -o default ncftp
_expand() _expand()
{ {
# expand ~username type directory specifications # expand ~username type directory specifications