pub fn uu_app() -> Commanddiff --git a/dev/src/uu_cksum/cksum.rs.html b/dev/src/uu_cksum/cksum.rs.html index ed9ed82fa..6c1fc4c1a 100644 --- a/dev/src/uu_cksum/cksum.rs.html +++ b/dev/src/uu_cksum/cksum.rs.html @@ -272,6 +272,23 @@ 272 273 274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291
// This file is part of the uutils coreutils package.
//
// (c) Michael Gehring <mg@ebfe.org>
@@ -280,7 +297,7 @@
// file that was distributed with this source code.
// spell-checker:ignore (ToDO) fname, algo
-use clap::{crate_version, Arg, Command};
+use clap::{crate_version, Arg, ArgAction, Command};
use hex::encode;
use std::ffi::OsStr;
use std::fs::File;
@@ -377,6 +394,7 @@
algo_name: &'static str,
digest: Box<dyn Digest + 'static>,
output_bits: usize,
+ untagged: bool,
}
/// Calculate checksum
@@ -435,12 +453,20 @@
),
(ALGORITHM_OPTIONS_CRC, true) => println!("{sum} {sz}"),
(ALGORITHM_OPTIONS_CRC, false) => println!("{sum} {sz} {}", filename.display()),
- (ALGORITHM_OPTIONS_BLAKE2B, _) => println!("BLAKE2b ({}) = {sum}", filename.display()),
- _ => println!(
- "{} ({}) = {sum}",
- options.algo_name.to_ascii_uppercase(),
- filename.display()
- ),
+ (ALGORITHM_OPTIONS_BLAKE2B, _) if !options.untagged => {
+ println!("BLAKE2b ({}) = {sum}", filename.display());
+ }
+ _ => {
+ if options.untagged {
+ println!("{sum} {}", filename.display());
+ } else {
+ println!(
+ "{} ({}) = {sum}",
+ options.algo_name.to_ascii_uppercase(),
+ filename.display()
+ );
+ }
+ }
}
}
@@ -482,8 +508,9 @@
}
mod options {
- pub static FILE: &str = "file";
- pub static ALGORITHM: &str = "algorithm";
+ pub const ALGORITHM: &str = "algorithm";
+ pub const FILE: &str = "file";
+ pub const UNTAGGED: &str = "untagged";
}
#[uucore::main]
@@ -502,6 +529,7 @@
algo_name: name,
digest: algo,
output_bits: bits,
+ untagged: matches.get_flag(options::UNTAGGED),
};
match matches.get_many::<String>(options::FILE) {
@@ -544,6 +572,12 @@
ALGORITHM_OPTIONS_SM3,
]),
)
+ .arg(
+ Arg::new(options::UNTAGGED)
+ .long(options::UNTAGGED)
+ .help("create a reversed style checksum, without digest type")
+ .action(ArgAction::SetTrue),
+ )
.after_help(AFTER_HELP)
}
diff --git a/dev/src/uu_cp/copydir.rs.html b/dev/src/uu_cp/copydir.rs.html
index 1e870cd5e..0018ab7c2 100644
--- a/dev/src/uu_cp/copydir.rs.html
+++ b/dev/src/uu_cp/copydir.rs.html
@@ -454,6 +454,16 @@
454
455
456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
// * This file is part of the uutils coreutils package.
// *
// * For the full copyright and license information, please view the LICENSE
@@ -860,8 +870,18 @@
Err(e) => show_error!("{}", e),
}
}
+
// Copy the attributes from the root directory to the target directory.
- copy_attributes(root, target, &options.attributes)?;
+ if options.parents {
+ let dest = target.join(root.file_name().unwrap());
+ copy_attributes(root, dest.as_path(), &options.attributes)?;
+ for (x, y) in aligned_ancestors(root, dest.as_path()) {
+ copy_attributes(x, y, &options.attributes)?;
+ }
+ } else {
+ copy_attributes(root, target, &options.attributes)?;
+ }
+
Ok(())
}
diff --git a/dev/src/uu_cp/cp.rs.html b/dev/src/uu_cp/cp.rs.html
index 583c657e2..2be7e6038 100644
--- a/dev/src/uu_cp/cp.rs.html
+++ b/dev/src/uu_cp/cp.rs.html
@@ -1896,26 +1896,6 @@
1896
1897
1898
-1899
-1900
-1901
-1902
-1903
-1904
-1905
-1906
-1907
-1908
-1909
-1910
-1911
-1912
-1913
-1914
-1915
-1916
-1917
-1918
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::extra_unused_lifetimes)]
@@ -3069,14 +3049,20 @@
} else {
// Copy as file
let dest = construct_dest_path(source_path, target, target_type, options)?;
- copy_file(
+ let res = copy_file(
progress_bar,
source_path,
dest.as_path(),
options,
symlinked_files,
true,
- )
+ );
+ if options.parents {
+ for (x, y) in aligned_ancestors(source, dest.as_path()) {
+ copy_attributes(x, y, &options.attributes)?;
+ }
+ }
+ res
}
}
@@ -3622,11 +3608,6 @@
}
copy_attributes(source, dest, &options.attributes)?;
- if options.parents && should_preserve_attribute(options) {
- for (x, y) in aligned_ancestors(source, dest) {
- copy_attributes(x, y, &options.attributes)?;
- }
- }
if let Some(progress_bar) = progress_bar {
progress_bar.inc(fs::metadata(source)?.len());
@@ -3676,27 +3657,6 @@
Ok(())
}
-fn should_preserve_attribute(options: &Options) -> bool {
- let checks = [
- &options.attributes.mode,
- &options.attributes.timestamps,
- &options.attributes.links,
- &options.attributes.context,
- &options.attributes.xattr,
- ];
-
- #[cfg(unix)]
- let checks = [
- checks.as_slice(),
- [&options.attributes.ownership].as_slice(),
- ]
- .concat();
-
- checks
- .iter()
- .any(|attr| matches!(attr, Preserve::Yes { .. }))
-}
-
// "Copies" a FIFO by creating a new one. This workaround is because Rust's
// built-in fs::copy does not handle FIFOs (see rust-lang/rust/issues/79390).
#[cfg(unix)]
diff --git a/dev/uu_cksum/fn.uu_app.html b/dev/uu_cksum/fn.uu_app.html
index 0be2c4450..4aa6ebbe2 100644
--- a/dev/uu_cksum/fn.uu_app.html
+++ b/dev/uu_cksum/fn.uu_app.html
@@ -1 +1 @@
-uu_app in uu_cksum - Rust
\ No newline at end of file
+uu_app in uu_cksum - Rust
\ No newline at end of file
diff --git a/dev/uu_cksum/fn.uumain.html b/dev/uu_cksum/fn.uumain.html
index 7860b0def..0c1da1626 100644
--- a/dev/uu_cksum/fn.uumain.html
+++ b/dev/uu_cksum/fn.uumain.html
@@ -1 +1 @@
-uumain in uu_cksum - Rust
\ No newline at end of file
+uumain in uu_cksum - Rust
\ No newline at end of file
diff --git a/dev/uu_cksum/index.html b/dev/uu_cksum/index.html
index 7f7f03e0a..ecb609215 100644
--- a/dev/uu_cksum/index.html
+++ b/dev/uu_cksum/index.html
@@ -1 +1 @@
-uu_cksum - Rust
\ No newline at end of file
+uu_cksum - Rust
\ No newline at end of file
diff --git a/dev/uu_cp/fn.localize_to_target.html b/dev/uu_cp/fn.localize_to_target.html
index 5011e121d..da1aac5e5 100644
--- a/dev/uu_cp/fn.localize_to_target.html
+++ b/dev/uu_cp/fn.localize_to_target.html
@@ -1,4 +1,4 @@
-localize_to_target in uu_cp - Rust Function uu_cp::localize_to_target
source · pub fn localize_to_target(
+localize_to_target in uu_cp - Rust Function uu_cp::localize_to_target
source · pub fn localize_to_target(
root: &Path,
source: &Path,
target: &Path
diff --git a/dev/uu_cp/fn.verify_target_type.html b/dev/uu_cp/fn.verify_target_type.html
index ff49f6241..470b38178 100644
--- a/dev/uu_cp/fn.verify_target_type.html
+++ b/dev/uu_cp/fn.verify_target_type.html
@@ -1,4 +1,4 @@
-verify_target_type in uu_cp - Rust Function uu_cp::verify_target_type
source · pub fn verify_target_type(
+verify_target_type in uu_cp - Rust Function uu_cp::verify_target_type
source · pub fn verify_target_type(
target: &Path,
target_type: &TargetType
) -> CopyResult<()>
Expand description
Generate an error message if target is not the correct target_type
diff --git a/dev/uu_cp/index.html b/dev/uu_cp/index.html
index 1d070dc87..e3637e605 100644
--- a/dev/uu_cp/index.html
+++ b/dev/uu_cp/index.html
@@ -1,2 +1,2 @@
-uu_cp - Rust Structs
- Re-usable, extensible copy options
Enums
- Specifies whether when overwrite files
- Specifies whether when overwrite files
- Possible arguments for
--reflink. - Possible arguments for
--sparse. - Specifies the expected file type of copy target
Functions
- Remove the
root prefix from source and prefix it with target
+uu_cp - Rust Structs
- Re-usable, extensible copy options
Enums
- Specifies whether when overwrite files
- Specifies whether when overwrite files
- Possible arguments for
--reflink. - Possible arguments for
--sparse. - Specifies the expected file type of copy target
Functions
- Remove the
root prefix from source and prefix it with target
to create a file that is local to target - Generate an error message if
target is not the correct target_type
Type Definitions
\ No newline at end of file