- _ncftp(): replace cut with sed, since the existing cut command uses

--output-delimiter, which FreeBSD's cut doesn't have. We now also output
  only the name of the bookmark, not the expansion to which it points.
This commit is contained in:
ianmacd 2002-03-24 19:26:34 +00:00
parent e7d9e8471f
commit 036ef0c3a8

View File

@ -1,6 +1,6 @@
# bash_completion - some programmable completion functions for bash 2.05a
#
# $Id: bash_completion,v 1.216 2002/03/24 20:05:07 ianmacd Exp $
# $Id: bash_completion,v 1.217 2002/03/24 20:26:34 ianmacd Exp $
#
# Copyright (C) Ian Macdonald <ian@caliban.org>
#
@ -1958,8 +1958,8 @@ _ncftp()
cur=${COMP_WORDS[COMP_CWORD]}
if [ $COMP_CWORD -eq 1 ] && [ -f ~/.ncftp/bookmarks ]; then
COMPREPLY=( $( compgen -W '`cut --output-delimiter " " \
-s -f1-2 -d, ~/.ncftp/bookmarks`' -- $cur ) )
COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\+\),.*$/\1/p" \
~/.ncftp/bookmarks )' -- $cur ) )
fi
return 0