1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 20:17:45 +00:00

cp: Accept --preserve=link

Used for example in:
tests/mv/hard-3.sh
This commit is contained in:
Sylvestre Ledru 2023-05-29 00:08:11 +02:00 committed by Sylvestre Ledru
parent b4f5a87f64
commit d303af31b7

View file

@ -278,14 +278,22 @@ static PRESERVABLE_ATTRIBUTES: &[&str] = &[
"ownership", "ownership",
"timestamps", "timestamps",
"context", "context",
"link",
"links", "links",
"xattr", "xattr",
"all", "all",
]; ];
#[cfg(not(unix))] #[cfg(not(unix))]
static PRESERVABLE_ATTRIBUTES: &[&str] = static PRESERVABLE_ATTRIBUTES: &[&str] = &[
&["mode", "timestamps", "context", "links", "xattr", "all"]; "mode",
"timestamps",
"context",
"link",
"links",
"xattr",
"all",
];
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
const MODE_ARGS: &[&str] = &[ const MODE_ARGS: &[&str] = &[
@ -713,7 +721,7 @@ impl Attributes {
"ownership" => self.ownership = preserve_yes_required, "ownership" => self.ownership = preserve_yes_required,
"timestamps" => self.timestamps = preserve_yes_required, "timestamps" => self.timestamps = preserve_yes_required,
"context" => self.context = 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, "xattr" => self.xattr = preserve_yes_required,
_ => { _ => {
return Err(Error::InvalidArgument(format!( return Err(Error::InvalidArgument(format!(