mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +00:00
rsync completions: use rsync --list-only to generate completions, allowing the use of rsync daemons
This commit is contained in:
parent
c177965da5
commit
b4d33a58b1
1 changed files with 5 additions and 7 deletions
|
@ -107,14 +107,12 @@ complete -c rsync -l help --description "Display help and exit"
|
||||||
#
|
#
|
||||||
# Remote path
|
# Remote path
|
||||||
#
|
#
|
||||||
complete -c rsync -d "Remote Path" -n "commandline -ct|sgrep -o '.*:'" -a "
|
complete -c rsync -d "Remote path" -n "commandline -ct|sgrep -q :" -a "
|
||||||
|
|
||||||
(
|
(
|
||||||
#Prepend any user@host information supplied before the remote completion
|
#Prepend any user@host:/path information supplied before the remote completion
|
||||||
commandline -ct|sgrep -o '.*:'
|
commandline -ct|sgrep -Eo '.*:+(.*/)?'
|
||||||
)(
|
)(
|
||||||
#Get the list of remote files from the specified ssh server
|
#Get the list of remote files from the specified rsync server
|
||||||
ssh -o \"BatchMode yes\" (commandline -ct|sed -ne 's/\(.*\):.*/\1/p') ls\ -dp\ (commandline -ct|sed -ne 's/.*://p')\* 2> /dev/null
|
rsync --list-only (commandline -ct|sgrep -Eo '.*:+(.*/)?') ^/dev/null | awk '{if (\$1 ~ \"^d\" ) {print \$NF \"/\";} else {print \$NF;} };'
|
||||||
)
|
)
|
||||||
|
|
||||||
"
|
"
|
||||||
|
|
Loading…
Reference in a new issue