Cp : Remove --.

This commit is contained in:
Dmitry Voronin 2023-12-24 16:03:10 +03:00
parent 4bc13cb1ba
commit ad875feb7d

View file

@ -1,20 +1,20 @@
# Replaces default cp with rsync. # Replaces default cp with rsync.
# Usage: cp <FROM> <TO> # Usage: cp <FROM> <TO>
function cp() { function cp() {
rsync -ahP --chmod=u+w -- "${@}" rsync -ahP --chmod=u+w "${@}"
} }
# Copy and also merge all changes (delete dst files that do not exist in src). # Copy and also merge all changes (delete dst files that do not exist in src).
# Usage: cp_merge <FROM> <TO> # Usage: cp_merge <FROM> <TO>
function cp_merge() { function cp_merge() {
rsync -ahP --chmod=u+w --delete -- "${@}" rsync -ahP --chmod=u+w --delete "${@}"
} }
# Copy by creating hardlinks. # Copy by creating hardlinks.
# Works for directories, too. # Works for directories, too.
# Usage: cp_link <FROM> <TO> # Usage: cp_link <FROM> <TO>
function cp_link() { function cp_link() {
/usr/bin/cp -lr -- "${@}" /usr/bin/cp -lr "${@}"
} }
# Default cp, a.k.a builtin cp. # Default cp, a.k.a builtin cp.
@ -26,5 +26,5 @@ function bcp() {
# Print output of cp_merge without writing anything. # Print output of cp_merge without writing anything.
# Usage: cp_test <FROM> <TO> # Usage: cp_test <FROM> <TO>
function cp_test() { function cp_test() {
rsync -ahP --chmod=u+w --delete -n -- "${@}" rsync -ahP --chmod=u+w --delete -n "${@}"
} }