From d303af31b78862644e291b71e747d4089102ee26 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 29 May 2023 00:08:11 +0200 Subject: [PATCH] cp: Accept --preserve=link Used for example in: tests/mv/hard-3.sh --- src/uu/cp/src/cp.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index f7069f04f..f8087c7f0 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -278,14 +278,22 @@ static PRESERVABLE_ATTRIBUTES: &[&str] = &[ "ownership", "timestamps", "context", + "link", "links", "xattr", "all", ]; #[cfg(not(unix))] -static PRESERVABLE_ATTRIBUTES: &[&str] = - &["mode", "timestamps", "context", "links", "xattr", "all"]; +static PRESERVABLE_ATTRIBUTES: &[&str] = &[ + "mode", + "timestamps", + "context", + "link", + "links", + "xattr", + "all", +]; pub fn uu_app() -> Command { const MODE_ARGS: &[&str] = &[ @@ -713,7 +721,7 @@ impl Attributes { "ownership" => self.ownership = preserve_yes_required, "timestamps" => self.timestamps = preserve_yes_required, "context" => self.context = preserve_yes_required, - "links" => self.links = preserve_yes_required, + "link" | "links" => self.links = preserve_yes_required, "xattr" => self.xattr = preserve_yes_required, _ => { return Err(Error::InvalidArgument(format!(