summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-14 09:52:57 +0900
committergit <svn-admin@ruby-lang.org>2022-07-14 16:26:47 +0900
commit025677560a477c5d54f6a199447b4c92f367cd39 (patch)
treea8d5ee0f82041e1a40b3edf7abb3f51bd1f1800c
parent7c58c55c11e60822b04413ae08856427b0cc1f6c (diff)
downloadruby-025677560a477c5d54f6a199447b4c92f367cd39.tar.gz
[ruby/un] Support `FileUtils.cp_lr`
https://github.com/ruby/un/commit/e976ad8a7c
-rw-r--r--lib/un.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/un.rb b/lib/un.rb
index 5feac92120..9242357215 100644
--- a/lib/un.rb
+++ b/lib/un.rb
@@ -79,13 +79,15 @@ end
#
# -p preserve file attributes if possible
# -r copy recursively
+# -l make hard link instead of copying (implies -r)
# -v verbose
#
def cp
- setup("pr") do |argv, options|
+ setup("prl") do |argv, options|
cmd = "cp"
cmd += "_r" if options.delete :r
+ cmd = "cp_lr" if options.delete :l
options[:preserve] = true if options.delete :p
dest = argv.pop
argv = argv[0] if argv.size == 1