diff options
author | David Adam <zanchey@ucc.gu.uwa.edu.au> | 2013-09-19 23:24:07 +0800 |
---|---|---|
committer | David Adam <zanchey@ucc.gu.uwa.edu.au> | 2013-09-19 23:24:36 +0800 |
commit | fdef82f89c744a219e0d2d524b3234fbc23b8fe7 (patch) | |
tree | 5c726b57d562857e22e1087d8d8ed7dc4abfe683 /share/completions/rsync.fish | |
parent | 3d68d1bbe2863c67d64b89fda0dbe302e7caa90f (diff) |
rsync completions: complete hostnames ala scp
Closes #1010
Diffstat (limited to 'share/completions/rsync.fish')
-rw-r--r-- | share/completions/rsync.fish | 16 |
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 " |