summaryrefslogtreecommitdiffstats
path: root/src/verb/builtin.rs
diff options
context:
space:
mode:
authorAlexander Kastler <github@xaka.eu>2022-04-17 12:25:29 +0200
committerAlexander Kastler <github@xaka.eu>2022-04-17 12:25:29 +0200
commitb71f6af43cb10c6f9624f08ce4d3b78409f4f317 (patch)
tree3d927f9be6334a95fb211476208f3d01205ce4c3 /src/verb/builtin.rs
parent4db12c67d383d6a11ffa74b621e3eb34b106a400 (diff)
Add cfg for cp command to separate between unix and windows
Diffstat (limited to 'src/verb/builtin.rs')
-rw-r--r--src/verb/builtin.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/verb/builtin.rs b/src/verb/builtin.rs
index 7cdc4f0..c93c312 100644
--- a/src/verb/builtin.rs
+++ b/src/verb/builtin.rs
@@ -97,12 +97,20 @@ pub fn builtin_verbs() -> Vec<Verb> {
internal(close_panel_ok),
internal(close_panel_cancel)
.with_key(key!(ctrl-w)),
+ #[cfg(unix)]
external(
"copy {newpath}",
"cp -r {file} {newpath:path-from-parent}",
StayInBroot,
)
.with_shortcut("cp"),
+ #[cfg(windows)]
+ external(
+ "copy {newpath}",
+ "xcopy /Q /H /Y /I {file} {newpath:path-from-parent}",
+ StayInBroot,
+ )
+ .with_shortcut("cp"),
#[cfg(feature = "clipboard")]
internal(copy_line)
.with_key(key!(alt-c)),