mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
cp: keep --preserve related code but ignore "unused" warnings
This commit is contained in:
parent
e1d41b84f3
commit
4a96b56d60
1 changed files with 11 additions and 0 deletions
11
src/cp/cp.rs
11
src/cp/cp.rs
|
@ -984,6 +984,17 @@ fn copy_file(source: &Path, dest: &Path, options: &Options) -> CopyResult<()> {
|
|||
println!("{}", context_for(source, dest));
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
{
|
||||
// TODO: implement --preserve flag
|
||||
let mut preserve_context = false;
|
||||
for attribute in &options.preserve_attributes {
|
||||
if *attribute == Attribute::Context {
|
||||
preserve_context = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
match options.copy_mode {
|
||||
CopyMode::Link => {
|
||||
fs::hard_link(source, dest).context(&*context_for(source, dest))?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue