ncftp: Add option completion.
parent
e8daf2d279
commit
2eeffeea7a
|
@ -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" ) )
|
||||
|
|
|
@ -12,8 +12,10 @@ setup
|
|||
|
||||
|
||||
assert_complete_any "ncftp "
|
||||
sync_after_int
|
||||
|
||||
|
||||
assert_complete_any "ncftp -"
|
||||
sync_after_int
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue