mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08: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
|
@ -107,14 +107,12 @@ complete -c rsync -l help --description "Display help and exit"
|
|||
#
|
||||
# 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
|
||||
commandline -ct|sgrep -o '.*:'
|
||||
#Prepend any user@host:/path information supplied before the remote completion
|
||||
commandline -ct|sgrep -Eo '.*:+(.*/)?'
|
||||
)(
|
||||
#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
|
||||
#Get the list of remote files from the specified rsync server
|
||||
rsync --list-only (commandline -ct|sgrep -Eo '.*:+(.*/)?') ^/dev/null | awk '{if (\$1 ~ \"^d\" ) {print \$NF \"/\";} else {print \$NF;} };'
|
||||
)
|
||||
|
||||
"
|
||||
|
|
Loading…
Reference in New Issue
Block a user