[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-108-gea90dc1
Ville Skyttä
ville.skytta at iki.fi
Sun Apr 24 15:50:50 UTC 2011
The following commit has been merged in the master branch:
commit ea90dc1a86b40c6d103016c5f160a025cadb064e
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sun Apr 24 18:50:40 2011 +0300
Use _split_longopt() in rsync.
diff --git a/completions/rsync b/completions/rsync
index d1eb3ae..1753f10 100644
--- a/completions/rsync
+++ b/completions/rsync
@@ -5,12 +5,13 @@ have rsync || return
_rsync()
{
local cur prev words cword
- _init_completion -n : || return
-
- # TODO: _split_longopt
+ _init_completion -n := || return
_expand || return 0
+ local split=false
+ _split_longopt && split=true
+
case $prev in
--config|--password-file|--include-from|--exclude-from|--files-from|\
--log-file|--write-batch|--only-write-batch|--read-batch)
@@ -36,6 +37,8 @@ _rsync()
;;
esac
+ $split && return 0
+
case $cur in
-*)
COMPREPLY=( $( compgen -W '--verbose --quiet --no-motd --checksum \
diff --git a/test/lib/completions/rsync.exp b/test/lib/completions/rsync.exp
index 221d090..42b7af8 100644
--- a/test/lib/completions/rsync.exp
+++ b/test/lib/completions/rsync.exp
@@ -12,8 +12,14 @@ setup
assert_complete_any "rsync "
+sync_after_int
+
+
+assert_complete "rsh ssh" "rsync --rsh "
+sync_after_int
+assert_complete "rsh ssh" "rsync --rsh="
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list