1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

cp: make --preserve use the defaults when empty

This commit is contained in:
Emil Suleymanov 2022-11-09 14:43:27 +01:00
parent 0324a9480e
commit 8591d99c1b

View file

@ -745,7 +745,12 @@ impl Options {
attributes.push(Attribute::from_str(attribute_str)?);
}
}
attributes
// `--preserve` case, use the defaults
if attributes.is_empty() {
DEFAULT_ATTRIBUTES.to_vec()
} else {
attributes
}
}
}
} else if matches.get_flag(options::ARCHIVE) {