aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/completions/rsync.fish
diff options
context:
space:
mode:
authorGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2013-09-19 23:24:07 +0800
committerGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2013-09-19 23:24:36 +0800
commitfdef82f89c744a219e0d2d524b3234fbc23b8fe7 (patch)
tree5c726b57d562857e22e1087d8d8ed7dc4abfe683 /share/completions/rsync.fish
parent3d68d1bbe2863c67d64b89fda0dbe302e7caa90f (diff)
rsync completions: complete hostnames ala scp
Closes #1010
Diffstat (limited to 'share/completions/rsync.fish')
-rw-r--r--share/completions/rsync.fish16
1 files changed, 16 insertions, 0 deletions
diff --git a/share/completions/rsync.fish b/share/completions/rsync.fish
index 5a758175..f749aaa5 100644
--- a/share/completions/rsync.fish
+++ b/share/completions/rsync.fish
@@ -105,6 +105,22 @@ 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
#
complete -c rsync -d "Remote path" -n "commandline -ct|sgrep -q :" -a "