diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2013-01-12 18:37:31 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2013-01-12 18:37:31 +0200 |
commit | 2eeffeea7a5c067f4dc0c7645f664cd6232264f0 (patch) | |
tree | 15bfa4261d8840fcf05af45fb76fce0e358e6f7c | |
parent | e8daf2d2790b90b2abebd63b7a5534f1ea7e446a (diff) | |
download | bash-completion-2eeffeea7a5c067f4dc0c7645f664cd6232264f0.tar.gz |
ncftp: Add option completion.
-rw-r--r-- | completions/ncftp | 11 | ||||
-rw-r--r-- | test/lib/completions/ncftp.exp | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/completions/ncftp b/completions/ncftp index 57347e0e..0d32cfe2 100644 --- a/completions/ncftp +++ b/completions/ncftp @@ -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" ) ) diff --git a/test/lib/completions/ncftp.exp b/test/lib/completions/ncftp.exp index 52d70756..d6683b86 100644 --- a/test/lib/completions/ncftp.exp +++ b/test/lib/completions/ncftp.exp @@ -12,8 +12,10 @@ setup assert_complete_any "ncftp " +sync_after_int +assert_complete_any "ncftp -" sync_after_int |