aboutsummaryrefslogtreecommitdiff
path: root/.oh-my-zsh/plugins/cp
diff options
context:
space:
mode:
authorMarvin Borner2019-03-05 01:09:01 +0100
committerMarvin Borner2019-03-05 01:09:01 +0100
commit55457187d18221e76bd12f0fb2cfab65c49b92fb (patch)
tree8db042d2d80710d54100c2709ad4332153ac848a /.oh-my-zsh/plugins/cp
Initial commit
Diffstat (limited to '.oh-my-zsh/plugins/cp')
-rw-r--r--.oh-my-zsh/plugins/cp/README.md32
-rw-r--r--.oh-my-zsh/plugins/cp/cp.plugin.zsh4
2 files changed, 36 insertions, 0 deletions
diff --git a/.oh-my-zsh/plugins/cp/README.md b/.oh-my-zsh/plugins/cp/README.md
new file mode 100644
index 0000000..e8a9b6c
--- /dev/null
+++ b/.oh-my-zsh/plugins/cp/README.md
@@ -0,0 +1,32 @@
+# cp plugin
+
+This plugin defines a `cpv` function that uses `rsync` so that you
+get the features and security of this command.
+
+To enable, add `cp` to your `plugins` array in your zshrc file:
+
+```zsh
+plugins=(... cp)
+```
+
+## Description
+
+The enabled options for rsync are:
+
+- `-p`: preserves permissions.
+
+- `-o`: preserves owner.
+
+* `-g`: preserves group.
+
+* `-b`: make a backup of the original file instead of overwriting it, if it exists.
+
+* `-r`: recurse directories.
+
+* `-hhh`: outputs numbers in human-readable format, in units of 1024 (K, M, G, T).
+
+* `--backup-dir=/tmp/rsync`: move backup copies to "/tmp/rsync".
+
+* `-e /dev/null`: only work on local files (disable remote shells).
+
+* `--progress`: display progress.
diff --git a/.oh-my-zsh/plugins/cp/cp.plugin.zsh b/.oh-my-zsh/plugins/cp/cp.plugin.zsh
new file mode 100644
index 0000000..fe6ea87
--- /dev/null
+++ b/.oh-my-zsh/plugins/cp/cp.plugin.zsh
@@ -0,0 +1,4 @@
+cpv() {
+ rsync -pogbr -hhh --backup-dir=/tmp/rsync -e /dev/null --progress "$@"
+}
+compdef _files cpv