diff --git a/completions/rsync b/completions/rsync index d1eb3ae8..1753f102 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 221d090b..42b7af8e 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