about summary refs log tree commit diff
path: root/Completion/Unix/Command/_rsync
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_rsync')
-rw-r--r--Completion/Unix/Command/_rsync193
1 files changed, 83 insertions, 110 deletions
diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync
index b6fa296a1..ee05f4841 100644
--- a/Completion/Unix/Command/_rsync
+++ b/Completion/Unix/Command/_rsync
@@ -15,7 +15,7 @@ if [[ -prefix *::*/ ]]; then
 
     _wanted files expl 'remote files and directories' \
       compadd -d remdispf ${remdispf##* }
-      
+
     _wanted files expl 'remote files and directories' \
       compadd -S/ -d remdispd ${remdispd##* }
 
@@ -45,7 +45,7 @@ elif [[ -prefix 1 *: ]]; then
 
     _wanted files expl 'remote files and directories' \
       compadd -d remdispf ${${remfiles:#*/}/[*=@|](#e)/}
-      
+
     _wanted files expl 'remote files and directories' \
       compadd -S/ -d remdispd ${${(M)remfiles:#*/}/${slash}(#e)/}
   else
@@ -61,118 +61,91 @@ elif [[ -prefix 1 *@ ]]; then
   _wanted -C user-at hosts expl "host for $user" \
       _combination -s '[:@]' "${tag}" users-hosts users="$user" hosts -S "$suf" "$@" -
 else
-   if compset -S '@*'; then
-      _wanted users expl "user" \
-        _combination -s '[:@]' "${tag}" users-hosts users -q "$@" -
-   else
-	_hosts -S:
-   fi
-
+  if compset -S '@*'; then
+    _wanted users expl "user" \
+	_combination -s '[:@]' "${tag}" users-hosts users -q "$@" -
+  else
+    _alternative 'user:users:_users -S @' 'host:hosts:_hosts -S:'
+  fi
 fi
 
 }
 
 _rsync_files() {
-_files || _rsync_remote_files
+  _alternative "file:files:_files" "remote-files:remote files:_rsync_remote_files"
 }
 
-
-_arguments -C -s \
-	'*:files:_rsync_files' \
- 	'(--verbose)-v[verbose]' \
- 	'(-v)--verbose' \
- 	'(--quiet)-q[quiet]' \
- 	'(-q)--quiet' \
- 	'(--checksum)-c[always checksum]' \
- 	'(-c)--checksum[always checksum]' \
- 	'(--archive)-a[archive mode]' \
- 	'(-a)--archive[archive mode]' \
- 	'(--recursive)-r[recurse into directories]' \
- 	'(-r)--recursive[recurse into directories]' \
- 	'(--relative)-R[use relative path names]' \
- 	'(-R)--relative[use relative path names]' \
- 	'(--backup)-b[make backups]' \
- 	'(-b)--backup[make backups]' \
- 	'--backup-dir[make backups into this directory]:backup directory:_files -/' \
-	'--suffix=[override backup suffix]:suffix:' \
- 	'(--update)-u[update only]' \
- 	'(-u)--update[update only]' \
- 	'(--links)-l[copy symlinks as symlinks]' \
- 	'(-l)--links[copy symlinks as symlinks]' \
- 	'(--copy-links)-L[copy referent of symlinks]' \
- 	'(-L)--copy-links[copy referent of symlinks]' \
- 	'--copy-unsafe-links[copy links outside the source tree]' \
- 	'--safe-links[ignore links outside the destination tree]' \
- 	'(--hard-links)-H[preserve hard links]' \
- 	'(-H)--hard-links[preserve hard links]' \
- 	'(--perms)-p[preserve permissions]' \
- 	'(-p)--perms[preserve permissions]' \
- 	'(--owner)-o[preserve owner]' \
- 	'(-o)--owner[preserve owner]' \
- 	'(--group)-g[preserve group]' \
- 	'(-g)--group[preserve group]' \
- 	'(--devices)-D[preserve devices]' \
- 	'(-D)--devices[preserve devices]' \
- 	'(--times)-t[preserve times]' \
- 	'(-t)--times[preserve times]' \
- 	'(--sparse)-S[handle sparse files efficiently]' \
- 	'(-S)--sparse[handle sparse files efficiently]' \
- 	'(--dry-run)-n[show what would have been transferred]' \
- 	'(-n)--dry-run[show what would have been transferred]' \
- 	'(--whole-file)-W[copy whole files]' \
- 	'(-W)--whole-file[copy whole files]' \
- 	'(--one-file-system)-x[do not cross filesystem boundaries]' \
- 	'(-x)--one-file-system[do not cross filesystem boundaries]' \
- 	'(--block-size)-B[checksum blocking size]:block size:' \
- 	'(-B)--block-size=[checksum blocking size]:block size:' \
- 	'(--rsh)-e[rsh command]:remote command:(rsh ssh)' \
- 	'(-e)--rsh[rsh command]:remote command:(rsh ssh)' \
-	'--rsync-path=[specify path to rsync on the remote machine]:remote command:' \
- 	'(--cvs-exclude)-C[autoignore files in the same way as CVS]' \
- 	'(-C)--cvs-exclude[autoignore files in the same way as CVS]' \
-	'--existing[only update files that already exist]' \
-	'--ignore-existing[ignore files that already exist on the receiving side]' \
-	'--delete[delete files that do not exist on the sending side]' \
-	'--delete-excluded[also delete excluded files on the receiving side]' \
-	'--delete-after[perform delete after transferring]' \
-	'--ignore-errors[delete even if there are IO errors]' \
-	'--max-delete=[do not delete more than NUM files]:number:' \
-	'--partial[keep partially transferred files]' \
-	'--force[force deletion of directories even if not empty]' \
-	'--numeric-ids[do not map uid/gid values by user/group name]' \
-	'--timeout=[set IO timeout in seconds]:seconds:' \
- 	'(--ignore-times)-I[do not exclude files that match length and time]' \
- 	'(-I)--ignore-times[do not exclude files that match length and time]' \
-	'--size-only[only use file size when determining if a file should be transferred]' \
-	'--modify-window=[timestamp window for file match]:seconds:' \
-	'(--temp-dir)-T[create temporary files in specified directory]:directory:_files -/' \
-	'(-T)--temp-dir=[create temporary files in specified directory]:directory:_files -/' \
-	'--compare-dest=[also compare destination files relative to specified directory]:directory:_files -/' \
-	'-P[equivalent to --partial --progress]' \
- 	'(--compress)-z[compress file data]' \
- 	'(-z)--compress[compress file data]' \
-	'--exclude=[exclude files matching pattern]:pattern:' \
-	'--exclude-from=[exclude patterns listed in file]:file:_files' \
-	'--include=[do not exclude files matching pattern]:pattern:' \
-	'--include-from=[do not exclude patterns listed in file]:file:_files' \
-	'--version[print version number]' \
-	'--daemon[run as a rsync daemon]' \
-	'--no-detach[do not detach from the parent]' \
-	'--address=[bind to the specified address]:address:_hosts' \
-	'--config=[specify alternate rsyncd.conf file]:file:_files' \
-	'--port=[specify alternate rsyncd port number]:port:' \
-	'--blocking-io[use blocking IO for the remote shell]' \
-	'--stats[give some file transfer stats]' \
-	'--progress[show progress during transfer]' \
-	'--log-format=[log file transfers using specified format]:format:' \
-	'--password-file=[get password from file]:file:_files' \
-	'--bwlimit=[limit bandwidth]:kbytes per second:' \
-	'--read-batch=[read batch file]:ext:' \
-	'--write-batch[write batch file]' \
- 	'(--help)-h[help]' \
- 	'(-h)--help[help]' \
- 	'-4[prefer IPv4]' \
- 	'-6[prefer IPv6]' \
-	   -- '*=COMMAND*:command:_command' \
-              '*=FILE*:file:_files' \
-              '*=DIR*:directory:_files -/'
+_arguments -s \
+  '*: :_rsync_files' \
+  '*'{-v,--verbose}'[increase verbosity]' \
+  '(-q --quiet)'{-q,--quiet}'[show less information during transfer]' \
+  '(-c --checksum)'{-c,--checksum}'[always checksum]' \
+  '(-a --archive)'{-a,--archive}'[archive mode]' \
+  '(-r --recursive)'{-r,--recursive}'[recurse into directories]' \
+  '(-E --relative)'{-R,--relative}'[use relative path names]' \
+  '(-b --backup)'{-b,--backup}'[make backups]' \
+  '--backup-dir[make backups into specified directory]:backup directory:_directories' \
+  '--suffix=[override backup suffix]:suffix' \
+  '(-u --update)'{-u,--update}'[update only]' \
+  '(-l --links)'{-l,--links}'[copy symlinks as symlinks]' \
+  '(-L --copy-links)'{-L,--copy-links}'[treat soft links like regular files]' \
+  '--copy-unsafe-links[copy links outside the source tree]' \
+  '--safe-links[ignore links outside the destination tree]' \
+  '(-H --hard-links)'{-H,--hard-links}'[preserve hard links]' \
+  '(-p --perms)'{-p,--perms}'[preserve permissions]' \
+  '(-o --owner)'{-o,--owner}'[preserve owner]' \
+  '(-g --group)'{-g,--group}'[preserve group]' \
+  '(-D --devices)'{-D,--devices}'[preserve devices]' \
+  '(-t --times)'{-t,--times}'[preserve times]' \
+  '(-S --sparse)'{-S,--sparse}'[handle sparse files efficiently]' \
+  '(-n --dry-run)'{-n,--dry-run}'[show what would have been transferred]' \
+  '(-W --whole-file --no-whole-file)'{-W,--whole-file}'[copy whole files]' \
+  '(-W --whole-file)--no-whole-file[always use incremental rsync algorithm]' \
+  '(-x --one-file-system)'{-x,--one-file-system}'[do not cross filesystem boundaries]' \
+  '(-B --block-size)'{-B,--block-size=}'[checksum blocking size]:block size' \
+  '(-e --rsh)'{-e,--rsh}'[rsh command]:remote command:(rsh ssh)' \
+  '--rsync-path=[specify path to rsync on the remote machine]:remote command:' \
+  '(-C --cvs-exclude)'{-C,--cvs-exclude}'[autoignore files in the same way as CVS]' \
+  '--existing[only update files that already exist]' \
+  '--ignore-existing[ignore files that already exist on the receiving side]' \
+  '--delete[delete files that do not exist on the sending side]' \
+  '--delete-excluded[also delete excluded files on the receiving side]' \
+  '--delete-after[perform delete after transferring]' \
+  '--ignore-errors[delete even if there are IO errors]' \
+  '--max-delete=[do not delete more than NUM files]:number:' \
+  '(-P)--partial[keep partially transferred files]' \
+  '--force[force deletion of directories even if not empty]' \
+  '--numeric-ids[do not map uid/gid values by user/group name]' \
+  '--timeout=[set IO timeout in seconds]:seconds:' \
+  '(-I --ignore-times)'{-I,--ignore-times}'[do not exclude files that match length and time]' \
+  '--size-only[only use file size when determining if a file should be transferred]' \
+  '--modify-window=[timestamp window for file match]:seconds:' \
+  '(-T --temp-dir)'{-T,--temp-dir=}'[create temporary files in specified directory]:directory:_files -/' \
+  '--compare-dest=[also compare destination files relative to specified directory]:directory:_files -/' \
+  '(--partial --progress)-P[equivalent to --partial --progress]' \
+  '(-z --compress)'{-z,--compress}'[compress file data]' \
+  '--exclude=[exclude files matching pattern]:pattern:' \
+  '--exclude-from=[exclude patterns listed in file]:file:_files' \
+  '--include=[do not exclude files matching pattern]:pattern:' \
+  '--include-from=[do not exclude patterns listed in file]:file:_files' \
+  '--version[print version number]' \
+  '--daemon[run as a rsync daemon]' \
+  '--no-detach[do not detach from the parent]' \
+  '--address=[bind to the specified address]:address:_hosts' \
+  '--config=[specify alternate rsyncd.conf file]:file:_files' \
+  '--port=[specify alternate rsyncd port number]:port:' \
+  '--blocking-io[use blocking IO for the remote shell]' \
+  '--no-blocking-io[turn off blocking IO when it is the default]' \
+  '--stats[give some file transfer stats]' \
+  '(-P)--progress[show progress during transfer]' \
+  '--log-format=[log file transfers using specified format]:format:' \
+  '--password-file=[get password from file]:file:_files' \
+  '--bwlimit=[limit bandwidth]:kbytes per second:' \
+  '--read-batch=[read batch file]:ext:' \
+  '--write-batch[write batch file]' \
+  '(-)'{-h,--help}'[display help information]' \
+  '-4[prefer IPv4]' \
+  '-6[prefer IPv6]' \
+     -- '*=COMMAND*:command:_command' \
+	'*=FILE*:file:_files' \
+	'*=DIR*:directory:_files -/'