ncftp: Add option completion.
This commit is contained in:
parent
e8daf2d279
commit
2eeffeea7a
@ -5,6 +5,17 @@ _ncftp()
|
|||||||
local cur prev words cword
|
local cur prev words cword
|
||||||
_init_completion || return
|
_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
|
if [[ $cword -eq 1 && -f ~/.ncftp/bookmarks ]]; then
|
||||||
COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \
|
COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \
|
||||||
~/.ncftp/bookmarks )' -- "$cur" ) )
|
~/.ncftp/bookmarks )' -- "$cur" ) )
|
||||||
|
@ -12,8 +12,10 @@ setup
|
|||||||
|
|
||||||
|
|
||||||
assert_complete_any "ncftp "
|
assert_complete_any "ncftp "
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "ncftp -"
|
||||||
sync_after_int
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user