ncftp: Add option completion.

master
Ville Skyttä 2013-01-12 18:37:31 +02:00
parent e8daf2d279
commit 2eeffeea7a
2 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,17 @@ _ncftp()
local cur prev words cword
_init_completion || return
case $prev in
-u|-p|-P|-j|-F)
return
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) )
return
fi
if [[ $cword -eq 1 && -f ~/.ncftp/bookmarks ]]; then
COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \
~/.ncftp/bookmarks )' -- "$cur" ) )

View File

@ -12,8 +12,10 @@ setup
assert_complete_any "ncftp "
sync_after_int
assert_complete_any "ncftp -"
sync_after_int