1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-17 02:51:01 +02:00

31357: _cp: add support for Mac OS X

If not GNU nor darwin, assume POSIX.
This commit is contained in:
Jun T 2013-04-29 22:50:05 +09:00 committed by Frank Terbeck
parent 8ab3a7b0e6
commit cbf6f144a9
2 changed files with 64 additions and 32 deletions

View file

@ -1,3 +1,7 @@
2013-04-29 Jun T <takimoto-j@kba.biglobe.ne.jp>
* 31357: Completion/Unix/Command/_cp: add support for Mac OS X
2013-04-29 Peter Stephenson <p.stephenson@samsung.com>
* 31356: Completion/Unix/Command/_subversion: typo noted by Bart.

View file

@ -1,7 +1,8 @@
#compdef cp
_arguments -s \
'(-a --archive)'{-a,--archive}'[same as -dpR]' \
if _pick_variant gnu=GNU unix --version; then
_arguments -s -S \
'(-a --archive)'{-a,--archive}'[same as -dR --preserve=all]' \
'(-b --backup)-b[backup]' \
'(-b --backup)--backup=[backup]:method:(none off numbered t existing nil simple never)' \
'--copy-contents[copy contents of special files when recursive]' \
@ -32,3 +33,30 @@ _arguments -s \
'--help' \
'--version' \
'*:file or directory:_files'
elif [[ "$OSTYPE" == darwin* ]]; then
_arguments -s -S \
'-R[copy directories recursively]' \
'(-L -P)-H[with -R, follow symlinks on the command line]' \
'(-H -P)-L[with -R, follow all symlinks]' \
'(-H -L)-P[with -R, do not follow symlinks (default)]' \
'(-i -n)-f[force overwriting existing file]' \
'(-f -n)-i[confirm before overwriting existing file]' \
'(-f -i)-n[do not overwrite existing file]' \
'-a[same as -pRP]' \
'-p[preserve timestamps, mode, owner, flags, ACLs, and Extended Attributes]' \
'-v[show file names as they are copied]' \
'-X[do not copy Extended Attributes or resource forks]' \
'(-)*:file or directory:_files'
else # assume POSIX
_arguments -s -S \
'-R[copy directories recursively]' \
'(-L -P)-H[with -R, follow symlinks on the command line]' \
'(-H -P)-L[with -R, follow all symlinks]' \
'(-H -L)-P[do not follow symlinks]' \
'(-i)-f[force overwriting existing file]' \
'(-f)-i[confirm before overwriting existing file]' \
'-p[preserve timestamps, mode, and owner]' \
'(-)*:file or directory:_files'
fi