From 0bc58b66a4850cdb8458a86c3d9a2fc81de82aa3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:14:42 +0200 Subject: Adding upstream version 1:2.11. Signed-off-by: Daniel Baumann --- completions/rsync | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 completions/rsync (limited to 'completions/rsync') diff --git a/completions/rsync b/completions/rsync new file mode 100644 index 0000000..0bf5389 --- /dev/null +++ b/completions/rsync @@ -0,0 +1,86 @@ +# bash completion for rsync -*- shell-script -*- + +_rsync() +{ + local cur prev words cword split + _init_completion -s -n : || return + + case $prev in + --config | --password-file | --include-from | --exclude-from | --files-from | \ + --log-file | --write-batch | --only-write-batch | --read-batch) + compopt +o nospace + _filedir + return + ;; + --temp-dir | --compare-dest | --backup-dir | --partial-dir | --copy-dest | \ + --link-dest | -!(-*)T) + compopt +o nospace + _filedir -d + return + ;; + --rsh | -!(-*)e) + compopt +o nospace + COMPREPLY=($(compgen -W 'rsh ssh' -- "$cur")) + return + ;; + --compress-level) + compopt +o nospace + COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) + return + ;; + esac + + $split && return + + _expand || return + + case $cur in + -*) + COMPREPLY=($(compgen -W '--verbose --quiet --no-motd --checksum + --archive --recursive --relative --no-implied-dirs + --backup --backup-dir= --suffix= --update --inplace --append + --append-verify --dirs --old-dirs --links --copy-links + --copy-unsafe-links --safe-links --copy-dirlinks + --keep-dirlinks --hard-links --perms --executability --chmod= + --acls --xattrs --owner --group --devices --copy-devices + --specials --times --omit-dir-times --super --fake-super + --sparse --dry-run --whole-file --no-whole-file + --one-file-system --block-size= --rsh= --rsync-path= + --existing --ignore-existing --remove-source-files --delete + --delete-before --delete-during --delete-delay --delete-after + --delete-excluded --ignore-errors --force --max-delete= + --max-size= --min-size= --partial --partial-dir= + --delay-updates --prune-empty-dirs --numeric-ids --timeout= + --contimeout= --ignore-times --size-only --modify-window= + --temp-dir= --fuzzy --compare-dest= --copy-dest= --link-dest= + --compress --compress-level= --skip-compress= --cvs-exclude + --filter= --exclude= --exclude-from= --include= --include-from= + --files-from= --from0 --protect-args --address= --port= + --sockopts= --blocking-io --no-blocking-io --stats + --8-bit-output --human-readable --progress --itemize-changes + --out-format= --log-file= --log-file-format= --password-file= + --list-only --bwlimit= --write-batch= --only-write-batch= + --read-batch= --protocol= --iconv= --ipv4 --ipv6 --version + --help --daemon --config= --no-detach' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] || compopt +o nospace + ;; + *:*) + # find which remote shell is used + local i shell=ssh + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} == -@(e|-rsh) ]]; then + shell=${words[i + 1]} + break + fi + done + [[ $shell == ssh ]] && _xfunc ssh _scp_remote_files + ;; + *) + _known_hosts_real -c -a -- "$cur" + _xfunc ssh _scp_local_files + ;; + esac +} && + complete -F _rsync -o nospace rsync + +# ex: filetype=sh -- cgit v1.2.3