Exclude current directory ('.') from rsync completions

Completing to '.' isn't useful and just gets in the way.
This commit is contained in:
Collin Styles 2022-09-29 16:26:02 -07:00 committed by Mahmoud Al-Qudsi
parent 8deab8d9ce
commit a5764663e7

View File

@ -205,6 +205,7 @@ complete -c rsync -d "Remote path" -n "commandline -ct | string match -q '*:*'"
)(
# Get the list of remote files from the specified rsync server.
rsync --list-only (__rsync_remote_target) 2>/dev/null | string replace -r '^d.*' '\$0/' |
string replace -r '(\S+\s+){4}' '' $(set -q new_escaping[1]; or echo ' | string escape -n'; echo)
string replace -r '(\S+\s+){4}' '' |
string match --invert './' $(set -q new_escaping[1]; or echo ' | string escape -n'; echo)
)
"