From fdef82f89c744a219e0d2d524b3234fbc23b8fe7 Mon Sep 17 00:00:00 2001 From: David Adam Date: Thu, 19 Sep 2013 23:24:07 +0800 Subject: [PATCH] rsync completions: complete hostnames ala scp Closes #1010 --- share/completions/rsync.fish | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/share/completions/rsync.fish b/share/completions/rsync.fish index 5a758175a..f749aaa55 100644 --- a/share/completions/rsync.fish +++ b/share/completions/rsync.fish @@ -104,6 +104,22 @@ 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" +# +# Hostname completion +# +complete -c rsync -d Hostname -a " + +(__fish_print_hostnames): + +( + #Prepend any username specified in the completion to the hostname + commandline -ct |sed -ne 's/\(.*@\).*/\1/p' +)(__fish_print_hostnames): + +(__fish_print_users)@\tUsername + +" + # # Remote path #