diff options
author | James French <frenchie@frenchie.id.au> | 2013-05-21 12:45:54 +0800 |
---|---|---|
committer | David Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au> | 2013-06-03 20:04:32 +0800 |
commit | c177965da5d4fbf3aed0d3e4f227572394b8d1bf (patch) | |
tree | 7df9239bbe68c88f2259b6649bb8d90874097304 /share/completions/rsync.fish | |
parent | 220e1e8fb5c4f88c8c97e5f07cb77d57d476be32 (diff) |
Rsync Remote Path Completion
Relevant section lifted from scp.fish
Silenced SSH output to squash banners and failed connections
Erroneous 'and true' removed
echo (commandline -ct) is exactly the same as commandline -ct
Diffstat (limited to 'share/completions/rsync.fish')
-rw-r--r-- | share/completions/rsync.fish | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/share/completions/rsync.fish b/share/completions/rsync.fish index 5bffb4b6..7ed1be82 100644 --- a/share/completions/rsync.fish +++ b/share/completions/rsync.fish @@ -104,3 +104,17 @@ complete -c rsync -s 6 -l ipv6 --description "Prefer IPv6" complete -c rsync -l version --description "Display version and exit" complete -c rsync -l help --description "Display help and exit" +# +# Remote path +# +complete -c rsync -d "Remote Path" -n "commandline -ct|sgrep -o '.*:'" -a " + +( + #Prepend any user@host information supplied before the remote completion + commandline -ct|sgrep -o '.*:' +)( + #Get the list of remote files from the specified ssh server + ssh -o \"BatchMode yes\" (commandline -ct|sed -ne 's/\(.*\):.*/\1/p') ls\ -dp\ (commandline -ct|sed -ne 's/.*://p')\* 2> /dev/null +) + +" |