diff --git a/dev/implementors/core/clone/trait.Clone.js b/dev/implementors/core/clone/trait.Clone.js
index d7dcf6367..d514aa1e9 100644
--- a/dev/implementors/core/clone/trait.Clone.js
+++ b/dev/implementors/core/clone/trait.Clone.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
-"uu_cp":[["impl Clone for ReflinkMode"],["impl Clone for ClobberMode"],["impl Clone for SparseMode"],["impl Clone for OverwriteMode"]],
+"uu_cp":[["impl Clone for Preserve"],["impl Clone for ClobberMode"],["impl Clone for SparseMode"],["impl Clone for ReflinkMode"],["impl Clone for OverwriteMode"]],
"uu_dd":[["impl Clone for Alarm"]],
"uu_factor":[["impl Clone for Factors"]],
"uu_install":[["impl Clone for MainFunction"]],
diff --git a/dev/implementors/core/cmp/trait.Eq.js b/dev/implementors/core/cmp/trait.Eq.js
index c9ea24e36..97472e621 100644
--- a/dev/implementors/core/cmp/trait.Eq.js
+++ b/dev/implementors/core/cmp/trait.Eq.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
-"uu_cp":[["impl Eq for ReflinkMode"],["impl Eq for ClobberMode"],["impl Eq for Preserve"],["impl Eq for OverwriteMode"],["impl Eq for SparseMode"]],
+"uu_cp":[["impl Eq for Preserve"],["impl Eq for OverwriteMode"],["impl Eq for SparseMode"],["impl Eq for ClobberMode"],["impl Eq for ReflinkMode"]],
"uu_dircolors":[["impl Eq for OutputFmt"]],
"uu_factor":[["impl Eq for Factors"]],
"uu_install":[["impl Eq for MainFunction"]],
diff --git a/dev/implementors/core/cmp/trait.Ord.js b/dev/implementors/core/cmp/trait.Ord.js
index 1d5eaa52f..f86137904 100644
--- a/dev/implementors/core/cmp/trait.Ord.js
+++ b/dev/implementors/core/cmp/trait.Ord.js
@@ -1,3 +1,4 @@
(function() {var implementors = {
+"uu_cp":[["impl Ord for Preserve"]],
"uucore":[["impl Ord for Range"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/dev/implementors/core/cmp/trait.PartialEq.js b/dev/implementors/core/cmp/trait.PartialEq.js
index 18c916119..85e9269dd 100644
--- a/dev/implementors/core/cmp/trait.PartialEq.js
+++ b/dev/implementors/core/cmp/trait.PartialEq.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
-"uu_cp":[["impl PartialEq<ClobberMode> for ClobberMode"],["impl PartialEq<Preserve> for Preserve"],["impl PartialEq<OverwriteMode> for OverwriteMode"],["impl PartialEq<ReflinkMode> for ReflinkMode"],["impl PartialEq<SparseMode> for SparseMode"]],
+"uu_cp":[["impl PartialEq<ClobberMode> for ClobberMode"],["impl PartialEq<ReflinkMode> for ReflinkMode"],["impl PartialEq<OverwriteMode> for OverwriteMode"],["impl PartialEq<SparseMode> for SparseMode"],["impl PartialEq<Preserve> for Preserve"]],
"uu_dircolors":[["impl PartialEq<OutputFmt> for OutputFmt"]],
"uu_factor":[["impl PartialEq<Factors> for Factors"]],
"uu_install":[["impl PartialEq<MainFunction> for MainFunction"]],
diff --git a/dev/implementors/core/cmp/trait.PartialOrd.js b/dev/implementors/core/cmp/trait.PartialOrd.js
index 22fada5ca..049e78376 100644
--- a/dev/implementors/core/cmp/trait.PartialOrd.js
+++ b/dev/implementors/core/cmp/trait.PartialOrd.js
@@ -1,4 +1,5 @@
(function() {var implementors = {
+"uu_cp":[["impl PartialOrd<Preserve> for Preserve"]],
"uu_sort":[["impl PartialOrd<GeneralF64ParseResult> for GeneralF64ParseResult"]],
"uucore":[["impl PartialOrd<Range> for Range"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/dev/implementors/core/convert/trait.From.js b/dev/implementors/core/convert/trait.From.js
index 801e61764..31874d7c8 100644
--- a/dev/implementors/core/convert/trait.From.js
+++ b/dev/implementors/core/convert/trait.From.js
@@ -1,4 +1,4 @@
(function() {var implementors = {
-"uu_cp":[["impl From<String> for Error"],["impl From<Error> for Error"],["impl<'a> From<Context<&'a str, Error>> for Error"],["impl From<StripPrefixError> for Error"],["impl From<Error> for Error"],["impl From<&'static str> for Error"],["impl<'a> From<Context<String, Error>> for Error"]],
+"uu_cp":[["impl From<Error> for Error"],["impl<'a> From<Context<String, Error>> for Error"],["impl From<Error> for Error"],["impl From<StripPrefixError> for Error"],["impl<'a> From<Context<&'a str, Error>> for Error"],["impl From<String> for Error"],["impl From<&'static str> for Error"]],
"uucore":[["impl From<Error<RichFormatter>> for Box<dyn UError>"],["impl From<DecodeError> for DecodeError"],["impl<T> From<T> for Box<dyn UError>where\n T: UError + 'static,"],["impl From<i32> for Box<dyn UError>"],["impl From<Errno> for UIoError"],["impl From<Error> for DecodeError"],["impl<I, T> From<I> for ShortcutValueParserwhere\n I: IntoIterator<Item = T>,\n T: Into<PossibleValue>,"],["impl From<Error> for Box<dyn UError>"],["impl From<Errno> for Box<dyn UError>"],["impl From<Error> for UIoError"],["impl From<DecodeError> for DecodeError"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/dev/implementors/core/fmt/trait.Debug.js b/dev/implementors/core/fmt/trait.Debug.js
index 684b79614..730ccea0d 100644
--- a/dev/implementors/core/fmt/trait.Debug.js
+++ b/dev/implementors/core/fmt/trait.Debug.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
-"uu_cp":[["impl Debug for Attributes"],["impl Debug for Error"],["impl Debug for Preserve"]],
+"uu_cp":[["impl Debug for Error"],["impl Debug for Preserve"],["impl Debug for Attributes"]],
"uu_dd":[["impl Debug for Alarm"]],
"uu_dircolors":[["impl Debug for OutputFmt"]],
"uu_factor":[["impl Debug for Factors"]],
diff --git a/dev/implementors/core/marker/trait.Copy.js b/dev/implementors/core/marker/trait.Copy.js
index faede9a2a..fd0d75ddb 100644
--- a/dev/implementors/core/marker/trait.Copy.js
+++ b/dev/implementors/core/marker/trait.Copy.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
-"uu_cp":[["impl Copy for ClobberMode"],["impl Copy for ReflinkMode"],["impl Copy for SparseMode"],["impl Copy for OverwriteMode"]],
+"uu_cp":[["impl Copy for OverwriteMode"],["impl Copy for Preserve"],["impl Copy for ReflinkMode"],["impl Copy for SparseMode"],["impl Copy for ClobberMode"]],
"uu_kill":[["impl Copy for Mode"]],
"uu_numfmt":[["impl Copy for RoundMethod"]],
"uu_sort":[["impl Copy for GeneralF64ParseResult"]],
diff --git a/dev/implementors/core/marker/trait.StructuralEq.js b/dev/implementors/core/marker/trait.StructuralEq.js
index e3a04012e..974b7aa54 100644
--- a/dev/implementors/core/marker/trait.StructuralEq.js
+++ b/dev/implementors/core/marker/trait.StructuralEq.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
-"uu_cp":[["impl StructuralEq for ClobberMode"],["impl StructuralEq for Preserve"],["impl StructuralEq for OverwriteMode"],["impl StructuralEq for ReflinkMode"],["impl StructuralEq for SparseMode"]],
+"uu_cp":[["impl StructuralEq for Preserve"],["impl StructuralEq for ReflinkMode"],["impl StructuralEq for SparseMode"],["impl StructuralEq for ClobberMode"],["impl StructuralEq for OverwriteMode"]],
"uu_dircolors":[["impl StructuralEq for OutputFmt"]],
"uu_factor":[["impl StructuralEq for Factors"]],
"uu_install":[["impl StructuralEq for MainFunction"]],
diff --git a/dev/implementors/core/marker/trait.StructuralPartialEq.js b/dev/implementors/core/marker/trait.StructuralPartialEq.js
index 9fd26488f..5eca953fb 100644
--- a/dev/implementors/core/marker/trait.StructuralPartialEq.js
+++ b/dev/implementors/core/marker/trait.StructuralPartialEq.js
@@ -1,5 +1,5 @@
(function() {var implementors = {
-"uu_cp":[["impl StructuralPartialEq for ReflinkMode"],["impl StructuralPartialEq for ClobberMode"],["impl StructuralPartialEq for OverwriteMode"],["impl StructuralPartialEq for SparseMode"],["impl StructuralPartialEq for Preserve"]],
+"uu_cp":[["impl StructuralPartialEq for ClobberMode"],["impl StructuralPartialEq for Preserve"],["impl StructuralPartialEq for SparseMode"],["impl StructuralPartialEq for ReflinkMode"],["impl StructuralPartialEq for OverwriteMode"]],
"uu_dircolors":[["impl StructuralPartialEq for OutputFmt"]],
"uu_factor":[["impl StructuralPartialEq for Factors"]],
"uu_install":[["impl StructuralPartialEq for MainFunction"]],
diff --git a/dev/search-index.js b/dev/search-index.js
index 2dbb641fb..21a87bdfa 100644
--- a/dev/search-index.js
+++ b/dev/search-index.js
@@ -112,7 +112,7 @@ var searchIndex = JSON.parse('{\
"uu_chroot":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_chroot"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\
"uu_cksum":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_cksum"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\
"uu_comm":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_comm"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\
-"uu_cp":{"doc":"","t":"NNNDNNNNENEGNENNNNNNNNNNNNNNNDEEENNGGENNNGGENNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFFFM","n":["Always","Always","AttrOnly","Attributes","Auto","Auto","Backup","Clobber","ClobberMode","Copy","CopyMode","CopyResult","Directory","Error","Error","File","Force","Interactive","InvalidArgument","IoErr","IoErrContext","Link","Never","Never","No","NoClobber","NotADirectory","NotAllFilesCopied","NotImplemented","Options","OverwriteMode","Preserve","ReflinkMode","RemoveDestination","Skipped","Source","SourceSlice","SparseMode","Standard","StripPrefixError","SymLink","Target","TargetSlice","TargetType","Update","WalkDirErr","Yes","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","code","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into","localize_to_target","provide","source","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","uu_app","uumain","verify_target_type","required"],"q":[[0,"uu_cp"],[158,"uu_cp::Preserve"]],"d":["","","","","","","Invalid arguments to backup","Default Always overwrite existing files","Specifies whether when overwrite files","","","","","","General copy error","","","Prompt before overwriting a file","Result of a skipped file","Simple io::Error wrapper","Wrapper for io::Error with path context","","","","","Never overwrite a file","","Represents the state when a non-fatal error has occurred …","All standard options are included as an an implementation …","Re-usable, extensible copy options","Specifies whether when overwrite files","","Possible arguments for --reflink.","","Result of a skipped file Currently happens when “no” …","","","Possible arguments for --sparse.","","Simple std::path::StripPrefixError wrapper","","","","Specifies the expected file type of copy target","","Simple walkdir::Error wrapper","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","Returns the argument unchanged.","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Remove the root prefix from source and prefix it with …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Generate an error message if target is not the correct …",""],"i":[3,4,29,0,3,4,5,2,0,29,0,0,28,0,5,28,1,2,5,5,5,29,3,4,8,2,5,5,5,0,0,0,0,1,5,0,0,0,1,5,29,0,0,0,29,5,8,28,29,30,5,1,2,3,4,11,8,28,29,30,5,1,2,3,4,11,8,1,2,3,4,1,2,3,4,5,1,2,3,4,8,1,2,3,4,8,5,5,11,8,28,29,30,5,5,5,5,5,5,5,5,1,2,3,4,11,8,28,29,30,5,1,2,3,4,11,8,0,5,5,1,2,3,4,5,28,29,30,5,1,2,3,4,11,8,28,29,30,5,1,2,3,4,11,8,28,29,30,5,1,2,3,4,11,8,0,0,0,31],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,1],[2,2],[3,3],[4,4],[[]],[[]],[[]],[[]],[5,6],[[1,1],7],[[2,2],7],[[3,3],7],[[4,4],7],[[8,8],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[5,9],10],[[5,9],10],[[11,9],10],[[8,9],10],[[]],[[]],[[]],[12,5],[13,5],[[[16,[14,15]]],5],[[]],[17,5],[[[16,[13,15]]],5],[15,5],[14,5],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[18,18,18],[[20,[19]]]],[21],[5,[[23,[22]]]],[[]],[[]],[[]],[[]],[[],13],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],26],[27,6],[[18,28],20],0],"c":[],"p":[[4,"ClobberMode"],[4,"OverwriteMode"],[4,"ReflinkMode"],[4,"SparseMode"],[4,"Error"],[15,"i32"],[15,"bool"],[4,"Preserve"],[3,"Formatter"],[6,"Result"],[3,"Attributes"],[3,"Error"],[3,"String"],[15,"str"],[3,"Error"],[3,"Context"],[3,"StripPrefixError"],[3,"Path"],[3,"PathBuf"],[6,"CopyResult"],[3,"Demand"],[8,"Error"],[4,"Option"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[4,"TargetType"],[4,"CopyMode"],[3,"Options"],[13,"Yes"]]},\
+"uu_cp":{"doc":"","t":"SNNNDNNNNENEGSNENNNNNNNSNSNNNNNNNDEEENNENNNENNNMMMMLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLMFMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMFMMMMMMLLMLMMLMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMFFMFMM","n":["ALL","Always","Always","AttrOnly","Attributes","Auto","Auto","Backup","Clobber","ClobberMode","Copy","CopyMode","CopyResult","DEFAULT","Directory","Error","Error","File","Force","Interactive","InvalidArgument","IoErr","IoErrContext","LINKS","Link","NONE","Never","Never","No","NoClobber","NotADirectory","NotAllFilesCopied","NotImplemented","Options","OverwriteMode","Preserve","ReflinkMode","RemoveDestination","Skipped","SparseMode","Standard","StripPrefixError","SymLink","TargetType","Update","WalkDirErr","Yes","attributes","attributes_only","backup","backup_suffix","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cli_dereference","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","code","context","copy","copy_contents","copy_mode","debug","dereference","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into","links","localize_to_target","mode","no_target_dir","one_file_system","overwrite","ownership","parents","parse_iter","partial_cmp","progress_bar","provide","recursive","reflink_mode","source","sparse_mode","strip_trailing_slashes","target_dir","timestamps","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","union","update","uu_app","uumain","verbose","verify_target_type","xattr","required"],"q":[[0,"uu_cp"],[193,"uu_cp::Preserve"]],"d":["","","","","Preservation settings for various attributes","","","Invalid arguments to backup","Default Always overwrite existing files","Specifies how to overwrite files.","","Copy action to perform","","","","","General copy error","","","Prompt before overwriting a file","Result of a skipped file","Simple io::Error wrapper","Wrapper for io::Error with path context","","","","","","","Never overwrite a file","","Represents the state when a non-fatal error has occurred …","All standard options are included as an an implementation …","Options for the cp command","Specifies whether files should be overwritten.","","Possible arguments for --reflink.","","Result of a skipped file Currently happens when “no” …","Possible arguments for --sparse.","","Simple std::path::StripPrefixError wrapper","","The expected file type of copy target","","Simple walkdir::Error wrapper","","--preserve=[=ATTRIBUTE_LIST] and …","--attributes-only","--backup[=CONTROL], -b","-S, --suffix","","","","","","","","","","","","","","","","","","","","","-H","","","","","","","","","","","","","","Copy all sources to target.","--copy-contents","Determines the type of copying that should be done","--debug","-L, --dereference","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Remove the root prefix from source and prefix it with …","","-T, --no-target-dir","-x, --one-file-system","Specifies what to do with an existing destination","","--parents","","","-g, --progress","","-R, -r, --recursive","--reflink[=WHEN]","","--sparse[=WHEN]","--strip-trailing-slashes","-t, --target-directory","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","--update[=UPDATE]","","","-v, --verbose","Generate an error message if target is not the correct …","",""],"i":[17,3,4,33,0,3,4,7,2,0,33,0,0,17,32,0,7,32,1,2,7,7,7,17,33,17,3,4,5,2,7,7,7,0,0,0,0,1,7,0,1,7,33,0,33,7,5,12,12,12,12,32,33,12,7,1,2,3,4,17,5,32,33,12,7,1,2,3,4,17,5,12,1,2,3,4,5,1,2,3,4,5,5,7,17,0,12,12,12,12,1,2,3,4,5,1,2,3,4,5,7,7,17,5,32,33,12,7,7,7,7,7,7,7,7,1,2,3,4,17,5,32,33,12,7,1,2,3,4,17,5,17,0,17,12,12,12,17,12,17,5,12,7,12,12,7,12,12,12,17,1,2,3,4,5,7,32,33,12,7,1,2,3,4,17,5,32,33,12,7,1,2,3,4,17,5,32,33,12,7,1,2,3,4,17,5,17,12,0,0,12,0,17,34],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[1,1],[2,2],[3,3],[4,4],[5,5],[[]],[[]],[[]],[[]],[[]],[[5,5],6],[7,8],0,[[[10,[9]],11,12],13],0,0,0,0,[[1,1],14],[[2,2],14],[[3,3],14],[[4,4],14],[[5,5],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[7,15],16],[[7,15],16],[[17,15],16],[[5,15],16],[[]],[[]],[[]],[[[20,[18,19]]],7],[21,7],[[[20,[22,19]]],7],[23,7],[18,7],[19,7],[[]],[22,7],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[11,11,11],[[13,[9]]]],0,0,0,0,0,0,[24,[[25,[17,7]]]],[[5,5],[[26,[6]]]],0,[27],0,0,[7,[[26,[28]]]],0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[],18],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[17,17],17],0,[[],30],[31,8],0,[[11,32],13],0,0],"c":[],"p":[[4,"ClobberMode"],[4,"OverwriteMode"],[4,"ReflinkMode"],[4,"SparseMode"],[4,"Preserve"],[4,"Ordering"],[4,"Error"],[15,"i32"],[3,"PathBuf"],[15,"slice"],[3,"Path"],[3,"Options"],[6,"CopyResult"],[15,"bool"],[3,"Formatter"],[6,"Result"],[3,"Attributes"],[3,"String"],[3,"Error"],[3,"Context"],[3,"Error"],[15,"str"],[3,"StripPrefixError"],[8,"Iterator"],[4,"Result"],[4,"Option"],[3,"Demand"],[8,"Error"],[3,"TypeId"],[3,"Command"],[8,"Args"],[4,"TargetType"],[4,"CopyMode"],[13,"Yes"]]},\
"uu_csplit":{"doc":"","t":"DLLFLLLLLFF","n":["CsplitOptions","borrow","borrow_mut","csplit","from","into","try_from","try_into","type_id","uu_app","uumain"],"q":[[0,"uu_csplit"]],"d":["Command line options for csplit.","","","Splits a file into severals according to the command line …","Returns the argument unchanged.","Calls U::from(self).","","","","",""],"i":[0,1,1,0,1,1,1,1,1,0,0],"f":[0,[[]],[[]],[[1,[2,[0]],3],[[4,[0]]]],[[]],[[]],[[],4],[[],4],[[],5],[[],6],[7,8]],"c":[],"p":[[3,"CsplitOptions"],[3,"Vec"],[8,"BufRead"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"]]},\
"uu_cut":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_cut"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\
"uu_date":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_date"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\
diff --git a/dev/src/uu_cp/copydir.rs.html b/dev/src/uu_cp/copydir.rs.html
index 08a820a96..371793043 100644
--- a/dev/src/uu_cp/copydir.rs.html
+++ b/dev/src/uu_cp/copydir.rs.html
@@ -491,7 +491,7 @@
use crate::{
aligned_ancestors, context_for, copy_attributes, copy_file, copy_link, preserve_hardlinks,
- CopyResult, Error, Options, TargetSlice,
+ CopyResult, Error, Options,
};
/// Ensure a Windows path starts with a `\\?`.
@@ -773,7 +773,7 @@
pub(crate) fn copy_directory(
progress_bar: &Option<ProgressBar>,
root: &Path,
- target: &TargetSlice,
+ target: &Path,
options: &Options,
symlinked_files: &mut HashSet<FileInformation>,
source_in_command_line: bool,
diff --git a/dev/src/uu_cp/cp.rs.html b/dev/src/uu_cp/cp.rs.html
index ec57f256d..072b92073 100644
--- a/dev/src/uu_cp/cp.rs.html
+++ b/dev/src/uu_cp/cp.rs.html
@@ -1995,6 +1995,67 @@
1995
1996
1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::extra_unused_lifetimes)]
@@ -2006,10 +2067,11 @@
// For the full copyright and license information, please view the LICENSE file
// that was distributed with this source code.
-// spell-checker:ignore (ToDO) copydir ficlone fiemap ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs xattrs symlinked deduplicated advcpmv
+// spell-checker:ignore (ToDO) copydir ficlone fiemap ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs xattrs symlinked deduplicated advcpmv nushell
use quick_error::quick_error;
use std::borrow::Cow;
+use std::cmp::Ordering;
use std::collections::HashSet;
use std::env;
#[cfg(not(windows))]
@@ -2048,6 +2110,7 @@
mod copydir;
mod platform;
+
quick_error! {
#[derive(Debug)]
pub enum Error {
@@ -2105,12 +2168,8 @@
}
pub type CopyResult<T> = Result<T, Error>;
-pub type Source = PathBuf;
-pub type SourceSlice = Path;
-pub type Target = PathBuf;
-pub type TargetSlice = Path;
-/// Specifies whether when overwrite files
+/// Specifies how to overwrite files.
#[derive(Clone, Copy, Eq, PartialEq)]
pub enum ClobberMode {
Force,
@@ -2118,7 +2177,7 @@
Standard,
}
-/// Specifies whether when overwrite files
+/// Specifies whether files should be overwritten.
#[derive(Clone, Copy, Eq, PartialEq)]
pub enum OverwriteMode {
/// [Default] Always overwrite existing files
@@ -2145,13 +2204,14 @@
Never,
}
-/// Specifies the expected file type of copy target
+/// The expected file type of copy target
pub enum TargetType {
Directory,
File,
}
-pub enum CopyMode {
+/// Copy action to perform
+pub enum CopyMode {
Link,
SymLink,
Copy,
@@ -2159,77 +2219,128 @@
AttrOnly,
}
-#[derive(Debug)]
+/// Preservation settings for various attributes
+///
+/// It should be derived from options as follows:
+///
+/// - if there is a list of attributes to preserve (i.e. `--preserve=ATTR_LIST`) parse that list with [`Attributes::parse_iter`],
+/// - if `-p` or `--preserve` is given without arguments, use [`Attributes::DEFAULT`],
+/// - if `-a`/`--archive` is passed, use [`Attributes::ALL`],
+/// - if `-d` is passed use [`Attributes::LINKS`],
+/// - otherwise, use [`Attributes::NONE`].
+///
+/// For full compatibility with GNU, these options should also combine. We
+/// currently only do a best effort imitation of that behavior, because it is
+/// difficult to achieve in clap, especially with `--no-preserve`.
+#[derive(Debug)]
pub struct Attributes {
#[cfg(unix)]
- ownership: Preserve,
- mode: Preserve,
- timestamps: Preserve,
- context: Preserve,
- links: Preserve,
- xattr: Preserve,
+ pub ownership: Preserve,
+ pub mode: Preserve,
+ pub timestamps: Preserve,
+ pub context: Preserve,
+ pub links: Preserve,
+ pub xattr: Preserve,
}
-impl Attributes {
- pub(crate) fn max(&mut self, other: Self) {
- #[cfg(unix)]
- {
- self.ownership = self.ownership.max(other.ownership);
- }
- self.mode = self.mode.max(other.mode);
- self.timestamps = self.timestamps.max(other.timestamps);
- self.context = self.context.max(other.context);
- self.links = self.links.max(other.links);
- self.xattr = self.xattr.max(other.xattr);
- }
-}
-
-#[derive(Debug, PartialEq, Eq)]
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Preserve {
No,
Yes { required: bool },
}
-impl Preserve {
- /// Preservation level should only increase, with no preservation being the lowest option,
- /// preserve but don't require - middle, and preserve and require - top.
- pub(crate) fn max(&self, other: Self) -> Self {
+impl PartialOrd for Preserve {
+ fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+ Some(self.cmp(other))
+ }
+}
+
+impl Ord for Preserve {
+ fn cmp(&self, other: &Self) -> Ordering {
match (self, other) {
- (Self::Yes { required: true }, _) | (_, Self::Yes { required: true }) => {
- Self::Yes { required: true }
- }
- (Self::Yes { required: false }, _) | (_, Self::Yes { required: false }) => {
- Self::Yes { required: false }
- }
- _ => Self::No,
+ (Self::No, Self::No) => Ordering::Equal,
+ (Self::Yes { .. }, Self::No) => Ordering::Greater,
+ (Self::No, Self::Yes { .. }) => Ordering::Less,
+ (
+ Self::Yes { required: req_self },
+ Self::Yes {
+ required: req_other,
+ },
+ ) => req_self.cmp(req_other),
}
}
}
-/// Re-usable, extensible copy options
+/// Options for the `cp` command
+///
+/// All options are public so that the options can be programmatically
+/// constructed by other crates, such as nushell. That means that this struct
+/// is part of our public API. It should therefore not be changed without good
+/// reason.
+///
+/// The fields are documented with the arguments that determine their value.
#[allow(dead_code)]
pub struct Options {
- attributes_only: bool,
- backup: BackupMode,
- copy_contents: bool,
- cli_dereference: bool,
- copy_mode: CopyMode,
- dereference: bool,
- no_target_dir: bool,
- one_file_system: bool,
- overwrite: OverwriteMode,
- parents: bool,
- sparse_mode: SparseMode,
- strip_trailing_slashes: bool,
- reflink_mode: ReflinkMode,
- attributes: Attributes,
- recursive: bool,
- backup_suffix: String,
- target_dir: Option<PathBuf>,
- update: UpdateMode,
- debug: bool,
- verbose: bool,
- progress_bar: bool,
+ /// `--attributes-only`
+ pub attributes_only: bool,
+ /// `--backup[=CONTROL]`, `-b`
+ pub backup: BackupMode,
+ /// `--copy-contents`
+ pub copy_contents: bool,
+ /// `-H`
+ pub cli_dereference: bool,
+ /// Determines the type of copying that should be done
+ ///
+ /// Set by the following arguments:
+ /// - `-l`, `--link`: [`CopyMode::Link`]
+ /// - `-s`, `--symbolic-link`: [`CopyMode::SymLink`]
+ /// - `-u`, `--update[=WHEN]`: [`CopyMode::Update`]
+ /// - `--attributes-only`: [`CopyMode::AttrOnly`]
+ /// - otherwise: [`CopyMode::Copy`]
+ pub copy_mode: CopyMode,
+ /// `-L`, `--dereference`
+ pub dereference: bool,
+ /// `-T`, `--no-target-dir`
+ pub no_target_dir: bool,
+ /// `-x`, `--one-file-system`
+ pub one_file_system: bool,
+ /// Specifies what to do with an existing destination
+ ///
+ /// Set by the following arguments:
+ /// - `-i`, `--interactive`: [`OverwriteMode::Interactive`]
+ /// - `-n`, `--no-clobber`: [`OverwriteMode::NoClobber`]
+ /// - otherwise: [`OverwriteMode::Clobber`]
+ ///
+ /// The `Interactive` and `Clobber` variants have a [`ClobberMode`] argument,
+ /// set by the following arguments:
+ /// - `-f`, `--force`: [`ClobberMode::Force`]
+ /// - `--remove-destination`: [`ClobberMode::RemoveDestination`]
+ /// - otherwise: [`ClobberMode::Standard`]
+ pub overwrite: OverwriteMode,
+ /// `--parents`
+ pub parents: bool,
+ /// `--sparse[=WHEN]`
+ pub sparse_mode: SparseMode,
+ /// `--strip-trailing-slashes`
+ pub strip_trailing_slashes: bool,
+ /// `--reflink[=WHEN]`
+ pub reflink_mode: ReflinkMode,
+ /// `--preserve=[=ATTRIBUTE_LIST]` and `--no-preserve=ATTRIBUTE_LIST`
+ pub attributes: Attributes,
+ /// `-R`, `-r`, `--recursive`
+ pub recursive: bool,
+ /// `-S`, `--suffix`
+ pub backup_suffix: String,
+ /// `-t`, `--target-directory`
+ pub target_dir: Option<PathBuf>,
+ /// `--update[=UPDATE]`
+ pub update: UpdateMode,
+ /// `--debug`
+ pub debug: bool,
+ /// `-v`, `--verbose`
+ pub verbose: bool,
+ /// `-g`, `--progress`
+ pub progress_bar: bool,
}
/// Enum representing various debug states of the offload and reflink actions.
@@ -2738,67 +2849,90 @@
}
impl Attributes {
+ pub const ALL: Self = Self {
+ #[cfg(unix)]
+ ownership: Preserve::Yes { required: true },
+ mode: Preserve::Yes { required: true },
+ timestamps: Preserve::Yes { required: true },
+ context: {
+ #[cfg(feature = "feat_selinux")]
+ {
+ Preserve::Yes { required: false }
+ }
+ #[cfg(not(feature = "feat_selinux"))]
+ {
+ Preserve::No
+ }
+ },
+ links: Preserve::Yes { required: true },
+ xattr: Preserve::Yes { required: false },
+ };
+
+ pub const NONE: Self = Self {
+ #[cfg(unix)]
+ ownership: Preserve::No,
+ mode: Preserve::No,
+ timestamps: Preserve::No,
+ context: Preserve::No,
+ links: Preserve::No,
+ xattr: Preserve::No,
+ };
+
// TODO: ownership is required if the user is root, for non-root users it's not required.
- // See: https://github.com/coreutils/coreutils/blob/master/src/copy.c#L3181
+ pub const DEFAULT: Self = Self {
+ #[cfg(unix)]
+ ownership: Preserve::Yes { required: true },
+ mode: Preserve::Yes { required: true },
+ timestamps: Preserve::Yes { required: true },
+ ..Self::NONE
+ };
- fn all() -> Self {
+ pub const LINKS: Self = Self {
+ links: Preserve::Yes { required: true },
+ ..Self::NONE
+ };
+
+ pub fn union(self, other: &Self) -> Self {
Self {
#[cfg(unix)]
- ownership: Preserve::Yes { required: true },
- mode: Preserve::Yes { required: true },
- timestamps: Preserve::Yes { required: true },
- context: {
- #[cfg(feature = "feat_selinux")]
- {
- Preserve::Yes { required: false }
- }
- #[cfg(not(feature = "feat_selinux"))]
- {
- Preserve::No
- }
- },
- links: Preserve::Yes { required: true },
- xattr: Preserve::Yes { required: false },
+ ownership: self.ownership.max(other.ownership),
+ context: self.context.max(other.context),
+ timestamps: self.timestamps.max(other.timestamps),
+ mode: self.mode.max(other.mode),
+ links: self.links.max(other.links),
+ xattr: self.xattr.max(other.xattr),
}
}
- fn default() -> Self {
- Self {
- #[cfg(unix)]
- ownership: Preserve::Yes { required: true },
- mode: Preserve::Yes { required: true },
- timestamps: Preserve::Yes { required: true },
- context: Preserve::No,
- links: Preserve::No,
- xattr: Preserve::No,
- }
- }
-
- fn none() -> Self {
- Self {
- #[cfg(unix)]
- ownership: Preserve::No,
- mode: Preserve::No,
- timestamps: Preserve::No,
- context: Preserve::No,
- links: Preserve::No,
- xattr: Preserve::No,
+ pub fn parse_iter<T>(values: impl Iterator<Item = T>) -> Result<Self, Error>
+ where
+ T: AsRef<str>,
+ {
+ let mut new = Self::NONE;
+ for value in values {
+ new = new.union(&Self::parse_single_string(value.as_ref())?);
}
+ Ok(new)
}
/// Tries to match string containing a parameter to preserve with the corresponding entry in the
/// Attributes struct.
- fn try_set_from_string(&mut self, value: &str) -> Result<(), Error> {
- let preserve_yes_required = Preserve::Yes { required: true };
+ fn parse_single_string(value: &str) -> Result<Self, Error> {
+ let value = value.to_lowercase();
- match &*value.to_lowercase() {
- "mode" => self.mode = preserve_yes_required,
+ if value == "all" {
+ return Ok(Self::ALL);
+ }
+
+ let mut new = Self::NONE;
+ let attribute = match value.as_ref() {
+ "mode" => &mut new.mode,
#[cfg(unix)]
- "ownership" => self.ownership = preserve_yes_required,
- "timestamps" => self.timestamps = preserve_yes_required,
- "context" => self.context = preserve_yes_required,
- "link" | "links" => self.links = preserve_yes_required,
- "xattr" => self.xattr = preserve_yes_required,
+ "ownership" => &mut new.ownership,
+ "timestamps" => &mut new.timestamps,
+ "context" => &mut new.context,
+ "link" | "links" => &mut new.links,
+ "xattr" => &mut new.xattr,
_ => {
return Err(Error::InvalidArgument(format!(
"invalid attribute {}",
@@ -2806,7 +2940,10 @@
)));
}
};
- Ok(())
+
+ *attribute = Preserve::Yes { required: true };
+
+ Ok(new)
}
}
@@ -2855,39 +2992,22 @@
};
// Parse attributes to preserve
- let attributes: Attributes = if matches.contains_id(options::PRESERVE) {
- match matches.get_many::<String>(options::PRESERVE) {
- None => Attributes::default(),
- Some(attribute_strs) => {
- let mut attributes: Attributes = Attributes::none();
- let mut attributes_empty = true;
- for attribute_str in attribute_strs {
- attributes_empty = false;
- if attribute_str == "all" {
- attributes.max(Attributes::all());
- } else {
- attributes.try_set_from_string(attribute_str)?;
- }
- }
- // `--preserve` case, use the defaults
- if attributes_empty {
- Attributes::default()
- } else {
- attributes
- }
- }
- }
+ let attributes = if let Some(attribute_strs) = matches.get_many::<String>(options::PRESERVE)
+ {
+ if attribute_strs.len() == 0 {
+ Attributes::DEFAULT
+ } else {
+ Attributes::parse_iter(attribute_strs)?
+ }
} else if matches.get_flag(options::ARCHIVE) {
// --archive is used. Same as --preserve=all
- Attributes::all()
+ Attributes::ALL
} else if matches.get_flag(options::NO_DEREFERENCE_PRESERVE_LINKS) {
- let mut attributes = Attributes::none();
- attributes.links = Preserve::Yes { required: true };
- attributes
+ Attributes::LINKS
} else if matches.get_flag(options::PRESERVE_DEFAULT_ATTRIBUTES) {
- Attributes::default()
+ Attributes::DEFAULT
} else {
- Attributes::none()
+ Attributes::NONE
};
#[cfg(not(feature = "feat_selinux"))]
@@ -2997,7 +3117,7 @@
///
/// Treat target as a dir if we have multiple sources or the target
/// exists and already is a directory
- fn determine(sources: &[Source], target: &TargetSlice) -> Self {
+ fn determine(sources: &[PathBuf], target: &Path) -> Self {
if sources.len() > 1 || target.is_dir() {
Self::Directory
} else {
@@ -3007,7 +3127,10 @@
}
/// Returns tuple of (Source paths, Target)
-fn parse_path_args(mut paths: Vec<Source>, options: &Options) -> CopyResult<(Vec<Source>, Target)> {
+fn parse_path_args(
+ mut paths: Vec<PathBuf>,
+ options: &Options,
+) -> CopyResult<(Vec<PathBuf>, PathBuf)> {
if paths.is_empty() {
// No files specified
return Err("missing file operand".into());
@@ -3119,14 +3242,13 @@
}
}
-/// Copy all `sources` to `target`. Returns an
-/// `Err(Error::NotAllFilesCopied)` if at least one non-fatal error was
-/// encountered.
+/// Copy all `sources` to `target`.
///
-/// Behavior depends on path`options`, see [`Options`] for details.
+/// Returns an `Err(Error::NotAllFilesCopied)` if at least one non-fatal error
+/// was encountered.
///
-/// [`Options`]: ./struct.Options.html
-fn copy(sources: &[Source], target: &TargetSlice, options: &Options) -> CopyResult<()> {
+/// Behavior is determined by the `options` parameter, see [`Options`] for details.
+pub fn copy(sources: &[PathBuf], target: &Path, options: &Options) -> CopyResult<()> {
let target_type = TargetType::determine(sources, target);
verify_target_type(target, &target_type)?;
@@ -3189,7 +3311,7 @@
fn construct_dest_path(
source_path: &Path,
- target: &TargetSlice,
+ target: &Path,
target_type: &TargetType,
options: &Options,
) -> CopyResult<PathBuf> {
@@ -3220,8 +3342,8 @@
fn copy_source(
progress_bar: &Option<ProgressBar>,
- source: &SourceSlice,
- target: &TargetSlice,
+ source: &Path,
+ target: &Path,
target_type: &TargetType,
options: &Options,
symlinked_files: &mut HashSet<FileInformation>,
diff --git a/dev/src/uu_nl/helper.rs.html b/dev/src/uu_nl/helper.rs.html
index c8939ce0f..593804c69 100644
--- a/dev/src/uu_nl/helper.rs.html
+++ b/dev/src/uu_nl/helper.rs.html
@@ -65,63 +65,10 @@
65
66
67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
// spell-checker:ignore (ToDO) conv
use crate::options;
-// parse_style parses a style string into a NumberingStyle.
-fn parse_style(chars: &[char]) -> Result<crate::NumberingStyle, String> {
- if chars.len() == 1 && chars[0] == 'a' {
- Ok(crate::NumberingStyle::All)
- } else if chars.len() == 1 && chars[0] == 't' {
- Ok(crate::NumberingStyle::NonEmpty)
- } else if chars.len() == 1 && chars[0] == 'n' {
- Ok(crate::NumberingStyle::None)
- } else if chars.len() > 1 && chars[0] == 'p' {
- let s: String = chars[1..].iter().cloned().collect();
- match regex::Regex::new(&s) {
- Ok(re) => Ok(crate::NumberingStyle::Regex(Box::new(re))),
- Err(_) => Err(String::from("Illegal regular expression")),
- }
- } else {
- Err(String::from("Illegal style encountered"))
- }
-}
-
// parse_options loads the options into the settings, returning an array of
// error messages.
#[allow(clippy::cognitive_complexity)]
@@ -136,47 +83,32 @@
.get_one::<String>(options::NUMBER_FORMAT)
.map(Into::into)
.unwrap_or_default();
- match opts.get_one::<String>(options::BODY_NUMBERING) {
+ match opts
+ .get_one::<String>(options::HEADER_NUMBERING)
+ .map(String::as_str)
+ .map(TryInto::try_into)
+ {
None => {}
- Some(val) => {
- let chars: Vec<char> = val.chars().collect();
- match parse_style(&chars) {
- Ok(s) => {
- settings.body_numbering = s;
- }
- Err(message) => {
- errs.push(message);
- }
- }
- }
+ Some(Ok(style)) => settings.header_numbering = style,
+ Some(Err(message)) => errs.push(message.to_string()),
}
- match opts.get_one::<String>(options::FOOTER_NUMBERING) {
+ match opts
+ .get_one::<String>(options::BODY_NUMBERING)
+ .map(String::as_str)
+ .map(TryInto::try_into)
+ {
None => {}
- Some(val) => {
- let chars: Vec<char> = val.chars().collect();
- match parse_style(&chars) {
- Ok(s) => {
- settings.footer_numbering = s;
- }
- Err(message) => {
- errs.push(message);
- }
- }
- }
+ Some(Ok(style)) => settings.body_numbering = style,
+ Some(Err(message)) => errs.push(message.to_string()),
}
- match opts.get_one::<String>(options::HEADER_NUMBERING) {
+ match opts
+ .get_one::<String>(options::FOOTER_NUMBERING)
+ .map(String::as_str)
+ .map(TryInto::try_into)
+ {
None => {}
- Some(val) => {
- let chars: Vec<char> = val.chars().collect();
- match parse_style(&chars) {
- Ok(s) => {
- settings.header_numbering = s;
- }
- Err(message) => {
- errs.push(message);
- }
- }
- }
+ Some(Ok(style)) => settings.footer_numbering = style,
+ Some(Err(message)) => errs.push(message.to_string()),
}
match opts.get_one::<usize>(options::NUMBER_WIDTH) {
None => {}
diff --git a/dev/src/uu_nl/nl.rs.html b/dev/src/uu_nl/nl.rs.html
index acbc45806..1aa94b309 100644
--- a/dev/src/uu_nl/nl.rs.html
+++ b/dev/src/uu_nl/nl.rs.html
@@ -359,6 +359,23 @@
359
360
361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
// * This file is part of the uutils coreutils package.
// *
// * (c) Tobias Bohumir Schottdorf <tobias.schottdorf@gmail.com>
@@ -432,6 +449,23 @@
Regex(Box<regex::Regex>),
}
+impl TryFrom<&str> for NumberingStyle {
+ type Error = String;
+
+ fn try_from(s: &str) -> Result<Self, Self::Error> {
+ match s {
+ "a" => Ok(Self::All),
+ "t" => Ok(Self::NonEmpty),
+ "n" => Ok(Self::None),
+ _ if s.starts_with('p') => match regex::Regex::new(&s[1..]) {
+ Ok(re) => Ok(Self::Regex(Box::new(re))),
+ Err(_) => Err(String::from("invalid regular expression")),
+ },
+ _ => Err(format!("invalid numbering style: '{s}'")),
+ }
+ }
+}
+
// NumberFormat specifies how line numbers are output within their allocated
// space. They are justified to the left or right, in the latter case with
// the option of having all unused space to its left turned into leading zeroes.
diff --git a/dev/uu_cp/all.html b/dev/uu_cp/all.html
index fa70a47c1..d4e6dd4ed 100644
--- a/dev/uu_cp/all.html
+++ b/dev/uu_cp/all.html
@@ -1 +1 @@
-List of all items in this crate List of all items
Structs
Enums
Functions
Type Definitions
\ No newline at end of file
+List of all items in this crate List of all items
Structs
Enums
Functions
Type Definitions
\ No newline at end of file
diff --git a/dev/uu_cp/enum.ClobberMode.html b/dev/uu_cp/enum.ClobberMode.html
index 65578dd71..62ea472e3 100644
--- a/dev/uu_cp/enum.ClobberMode.html
+++ b/dev/uu_cp/enum.ClobberMode.html
@@ -1,11 +1,11 @@
-ClobberMode in uu_cp - Rust Enum uu_cp::ClobberMode
source · pub enum ClobberMode {
+ClobberMode in uu_cp - Rust Enum uu_cp::ClobberMode
source · pub enum ClobberMode {
Force,
RemoveDestination,
Standard,
-}
Expand description
Specifies whether when overwrite files
-Variants§
Trait Implementations§
source§impl Clone for ClobberMode
source§fn clone(&self) -> ClobberMode
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl PartialEq<ClobberMode> for ClobberMode
source§fn eq(&self, other: &ClobberMode) -> bool
This method tests for self and other values to be equal, and is used
+}Expand description
Specifies how to overwrite files.
+Variants§
Trait Implementations§
source§impl Clone for ClobberMode
source§fn clone(&self) -> ClobberMode
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl PartialEq<ClobberMode> for ClobberMode
source§fn eq(&self, other: &ClobberMode) -> bool
This method tests for self and other values to be equal, and is used
by ==.source§impl Copy for ClobberMode
source§impl Eq for ClobberMode
source§impl StructuralEq for ClobberMode
source§impl StructuralPartialEq for ClobberMode
Auto Trait Implementations§
§impl RefUnwindSafe for ClobberMode
§impl Send for ClobberMode
§impl Sync for ClobberMode
§impl Unpin for ClobberMode
§impl UnwindSafe for ClobberMode
Blanket Implementations§
source§impl Copy for ClobberMode
source§impl Eq for ClobberMode
source§impl StructuralEq for ClobberMode
source§impl StructuralPartialEq for ClobberMode
Auto Trait Implementations§
§impl RefUnwindSafe for ClobberMode
§impl Send for ClobberMode
§impl Sync for ClobberMode
§impl Unpin for ClobberMode
§impl UnwindSafe for ClobberMode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/dev/uu_cp/enum.CopyMode.html b/dev/uu_cp/enum.CopyMode.html
index 4ad78d564..14b996a36 100644
--- a/dev/uu_cp/enum.CopyMode.html
+++ b/dev/uu_cp/enum.CopyMode.html
@@ -1,10 +1,11 @@
-CopyMode in uu_cp - Rust pub enum CopyMode {
+CopyMode in uu_cp - Rust pub enum CopyMode {
Link,
SymLink,
Copy,
Update,
AttrOnly,
-}
Variants§
Auto Trait Implementations§
§impl RefUnwindSafe for CopyMode
§impl Send for CopyMode
§impl Sync for CopyMode
§impl Unpin for CopyMode
§impl UnwindSafe for CopyMode
Blanket Implementations§
source§impl<T> Any for Twhere
+}Expand description
Copy action to perform
+Variants§
Auto Trait Implementations§
§impl RefUnwindSafe for CopyMode
§impl Send for CopyMode
§impl Sync for CopyMode
§impl Unpin for CopyMode
§impl UnwindSafe for CopyMode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/dev/uu_cp/enum.Error.html b/dev/uu_cp/enum.Error.html
index b02b39ae3..cdcd57f3a 100644
--- a/dev/uu_cp/enum.Error.html
+++ b/dev/uu_cp/enum.Error.html
@@ -1,4 +1,4 @@
-Error in uu_cp - Rust pub enum Error {
+Error in uu_cp - Rust pub enum Error {
IoErr(Error),
IoErrContext(Error, String),
Error(String),
@@ -24,7 +24,7 @@ Currently happens when “no” is selected in interactive mode
path, but those that are not implemented yet should return
a NotImplemented error.
§Backup(String)
Invalid arguments to backup
-§NotADirectory(PathBuf)
Trait Implementations§
source§impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<StripPrefixError> for Error
source§fn from(err: StripPrefixError) -> Error
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for Error
§impl Send for Error
§impl Sync for Error
§impl Unpin for Error
§impl !UnwindSafe for Error
Blanket Implementations§
§NotADirectory(PathBuf)
Trait Implementations§
source§impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<StripPrefixError> for Error
source§fn from(err: StripPrefixError) -> Error
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for Error
§impl Send for Error
§impl Sync for Error
§impl Unpin for Error
§impl !UnwindSafe for Error
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/dev/uu_cp/enum.OverwriteMode.html b/dev/uu_cp/enum.OverwriteMode.html
index 66b23a790..a3b130042 100644
--- a/dev/uu_cp/enum.OverwriteMode.html
+++ b/dev/uu_cp/enum.OverwriteMode.html
@@ -1,14 +1,14 @@
-OverwriteMode in uu_cp - Rust Enum uu_cp::OverwriteMode
source · pub enum OverwriteMode {
+OverwriteMode in uu_cp - Rust Enum uu_cp::OverwriteMode
source · pub enum OverwriteMode {
Clobber(ClobberMode),
Interactive(ClobberMode),
NoClobber,
-}
Expand description
Specifies whether when overwrite files
+}Expand description
Specifies whether files should be overwritten.
Variants§
§Clobber(ClobberMode)
Default Always overwrite existing files
§Interactive(ClobberMode)
Prompt before overwriting a file
§NoClobber
Never overwrite a file
-Trait Implementations§
source§impl Clone for OverwriteMode
source§fn clone(&self) -> OverwriteMode
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl PartialEq<OverwriteMode> for OverwriteMode
source§fn eq(&self, other: &OverwriteMode) -> bool
This method tests for self and other values to be equal, and is used
+Trait Implementations§
source§impl Clone for OverwriteMode
source§fn clone(&self) -> OverwriteMode
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl PartialEq<OverwriteMode> for OverwriteMode
source§fn eq(&self, other: &OverwriteMode) -> bool
This method tests for self and other values to be equal, and is used
by ==.source§impl Copy for OverwriteMode
source§impl Eq for OverwriteMode
source§impl StructuralEq for OverwriteMode
source§impl StructuralPartialEq for OverwriteMode
Auto Trait Implementations§
§impl RefUnwindSafe for OverwriteMode
§impl Send for OverwriteMode
§impl Sync for OverwriteMode
§impl Unpin for OverwriteMode
§impl UnwindSafe for OverwriteMode
Blanket Implementations§
source§impl Copy for OverwriteMode
source§impl Eq for OverwriteMode
source§impl StructuralEq for OverwriteMode
source§impl StructuralPartialEq for OverwriteMode
Auto Trait Implementations§
§impl RefUnwindSafe for OverwriteMode
§impl Send for OverwriteMode
§impl Sync for OverwriteMode
§impl Unpin for OverwriteMode
§impl UnwindSafe for OverwriteMode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/dev/uu_cp/enum.Preserve.html b/dev/uu_cp/enum.Preserve.html
index 8db368827..510b4f22f 100644
--- a/dev/uu_cp/enum.Preserve.html
+++ b/dev/uu_cp/enum.Preserve.html
@@ -1,11 +1,16 @@
-Preserve in uu_cp - Rust pub enum Preserve {
+Preserve in uu_cp - Rust pub enum Preserve {
No,
Yes {
required: bool,
},
-}
Variants§
Trait Implementations§
source§impl PartialEq<Preserve> for Preserve
source§fn eq(&self, other: &Preserve) -> bool
This method tests for self and other values to be equal, and is used
+}Variants§
Trait Implementations§
source§impl Ord for Preserve
source§impl PartialEq<Preserve> for Preserve
source§impl Eq for Preserve
source§impl StructuralEq for Preserve
source§impl StructuralPartialEq for Preserve
Auto Trait Implementations§
§impl RefUnwindSafe for Preserve
§impl Send for Preserve
§impl Sync for Preserve
§impl Unpin for Preserve
§impl UnwindSafe for Preserve
Blanket Implementations§
source§impl PartialOrd<Preserve> for Preserve
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
+operator. Read moresource§impl Copy for Preserve
source§impl Eq for Preserve
source§impl StructuralEq for Preserve
source§impl StructuralPartialEq for Preserve
Auto Trait Implementations§
§impl RefUnwindSafe for Preserve
§impl Send for Preserve
§impl Sync for Preserve
§impl Unpin for Preserve
§impl UnwindSafe for Preserve
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
\ No newline at end of file
diff --git a/dev/uu_cp/enum.ReflinkMode.html b/dev/uu_cp/enum.ReflinkMode.html
index 91b8672dd..138cb4077 100644
--- a/dev/uu_cp/enum.ReflinkMode.html
+++ b/dev/uu_cp/enum.ReflinkMode.html
@@ -1,11 +1,11 @@
-ReflinkMode in uu_cp - Rust Enum uu_cp::ReflinkMode
source · pub enum ReflinkMode {
+ReflinkMode in uu_cp - Rust Enum uu_cp::ReflinkMode
source · pub enum ReflinkMode {
Always,
Auto,
Never,
}
Expand description
Possible arguments for --reflink.
-Variants§
Trait Implementations§
source§impl Clone for ReflinkMode
source§fn clone(&self) -> ReflinkMode
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl PartialEq<ReflinkMode> for ReflinkMode
source§fn eq(&self, other: &ReflinkMode) -> bool
This method tests for self and other values to be equal, and is used
+Variants§
Trait Implementations§
source§impl Clone for ReflinkMode
source§fn clone(&self) -> ReflinkMode
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl PartialEq<ReflinkMode> for ReflinkMode
source§fn eq(&self, other: &ReflinkMode) -> bool
This method tests for self and other values to be equal, and is used
by ==.source§impl Copy for ReflinkMode
source§impl Eq for ReflinkMode
source§impl StructuralEq for ReflinkMode
source§impl StructuralPartialEq for ReflinkMode
Auto Trait Implementations§
§impl RefUnwindSafe for ReflinkMode
§impl Send for ReflinkMode
§impl Sync for ReflinkMode
§impl Unpin for ReflinkMode
§impl UnwindSafe for ReflinkMode
Blanket Implementations§
source§impl Copy for ReflinkMode
source§impl Eq for ReflinkMode
source§impl StructuralEq for ReflinkMode
source§impl StructuralPartialEq for ReflinkMode
Auto Trait Implementations§
§impl RefUnwindSafe for ReflinkMode
§impl Send for ReflinkMode
§impl Sync for ReflinkMode
§impl Unpin for ReflinkMode
§impl UnwindSafe for ReflinkMode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/dev/uu_cp/enum.SparseMode.html b/dev/uu_cp/enum.SparseMode.html
index ab8a8b8af..459fe6818 100644
--- a/dev/uu_cp/enum.SparseMode.html
+++ b/dev/uu_cp/enum.SparseMode.html
@@ -1,11 +1,11 @@
-SparseMode in uu_cp - Rust Enum uu_cp::SparseMode
source · pub enum SparseMode {
+SparseMode in uu_cp - Rust Enum uu_cp::SparseMode
source · pub enum SparseMode {
Always,
Auto,
Never,
}
Expand description
Possible arguments for --sparse.
-Variants§
Trait Implementations§
source§impl Clone for SparseMode
source§fn clone(&self) -> SparseMode
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl PartialEq<SparseMode> for SparseMode
source§fn eq(&self, other: &SparseMode) -> bool
This method tests for self and other values to be equal, and is used
+Variants§
Trait Implementations§
source§impl Clone for SparseMode
source§fn clone(&self) -> SparseMode
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moresource§impl PartialEq<SparseMode> for SparseMode
source§fn eq(&self, other: &SparseMode) -> bool
This method tests for self and other values to be equal, and is used
by ==.source§impl Copy for SparseMode
source§impl Eq for SparseMode
source§impl StructuralEq for SparseMode
source§impl StructuralPartialEq for SparseMode
Auto Trait Implementations§
§impl RefUnwindSafe for SparseMode
§impl Send for SparseMode
§impl Sync for SparseMode
§impl Unpin for SparseMode
§impl UnwindSafe for SparseMode
Blanket Implementations§
source§impl Copy for SparseMode
source§impl Eq for SparseMode
source§impl StructuralEq for SparseMode
source§impl StructuralPartialEq for SparseMode
Auto Trait Implementations§
§impl RefUnwindSafe for SparseMode
§impl Send for SparseMode
§impl Sync for SparseMode
§impl Unpin for SparseMode
§impl UnwindSafe for SparseMode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/dev/uu_cp/enum.TargetType.html b/dev/uu_cp/enum.TargetType.html
index d121f5ef3..9cc7703e5 100644
--- a/dev/uu_cp/enum.TargetType.html
+++ b/dev/uu_cp/enum.TargetType.html
@@ -1,7 +1,7 @@
-TargetType in uu_cp - Rust Enum uu_cp::TargetType
source · pub enum TargetType {
+TargetType in uu_cp - Rust Enum uu_cp::TargetType
source · pub enum TargetType {
Directory,
File,
-}
Expand description
Specifies the expected file type of copy target
+}Expand description
The expected file type of copy target
Variants§
Auto Trait Implementations§
§impl RefUnwindSafe for TargetType
§impl Send for TargetType
§impl Sync for TargetType
§impl Unpin for TargetType
§impl UnwindSafe for TargetType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/dev/uu_cp/fn.copy.html b/dev/uu_cp/fn.copy.html
new file mode 100644
index 000000000..8222a7950
--- /dev/null
+++ b/dev/uu_cp/fn.copy.html
@@ -0,0 +1,9 @@
+copy in uu_cp - Rust pub fn copy(
+ sources: &[PathBuf],
+ target: &Path,
+ options: &Options
+) -> CopyResult<()>
Expand description
Copy all sources to target.
+Returns an Err(Error::NotAllFilesCopied) if at least one non-fatal error
+was encountered.
+Behavior is determined by the options parameter, see Options for details.
+
\ 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 5ce143f6a..0c6c32d88 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.uu_app.html b/dev/uu_cp/fn.uu_app.html
index d822573cd..4fa5653a5 100644
--- a/dev/uu_cp/fn.uu_app.html
+++ b/dev/uu_cp/fn.uu_app.html
@@ -1 +1 @@
-uu_app in uu_cp - Rust
\ No newline at end of file
+uu_app in uu_cp - Rust
\ No newline at end of file
diff --git a/dev/uu_cp/fn.uumain.html b/dev/uu_cp/fn.uumain.html
index 844d338ce..9da7e1165 100644
--- a/dev/uu_cp/fn.uumain.html
+++ b/dev/uu_cp/fn.uumain.html
@@ -1 +1 @@
-uumain in uu_cp - Rust
\ No newline at end of file
+uumain in uu_cp - Rust
\ No newline at end of file
diff --git a/dev/uu_cp/fn.verify_target_type.html b/dev/uu_cp/fn.verify_target_type.html
index b97dc8bba..f3e0d6f06 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 f0ea79b8b..73d07e351 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
-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
+uu_cp - Rust Structs
- Preservation settings for various attributes
- Options for the
cp command
Enums
- Specifies how to overwrite files.
- Copy action to perform
- Specifies whether files should be overwritten.
- Possible arguments for
--reflink. - Possible arguments for
--sparse. - The expected file type of copy target
Functions
- Copy all
sources to target. - 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
diff --git a/dev/uu_cp/sidebar-items.js b/dev/uu_cp/sidebar-items.js
index 1c0ab3a20..235906b65 100644
--- a/dev/uu_cp/sidebar-items.js
+++ b/dev/uu_cp/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"enum":["ClobberMode","CopyMode","Error","OverwriteMode","Preserve","ReflinkMode","SparseMode","TargetType"],"fn":["localize_to_target","uu_app","uumain","verify_target_type"],"struct":["Attributes","Options"],"type":["CopyResult","Source","SourceSlice","Target","TargetSlice"]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"enum":["ClobberMode","CopyMode","Error","OverwriteMode","Preserve","ReflinkMode","SparseMode","TargetType"],"fn":["copy","localize_to_target","uu_app","uumain","verify_target_type"],"struct":["Attributes","Options"],"type":["CopyResult"]};
\ No newline at end of file
diff --git a/dev/uu_cp/struct.Attributes.html b/dev/uu_cp/struct.Attributes.html
index 8469c3faf..5703cc286 100644
--- a/dev/uu_cp/struct.Attributes.html
+++ b/dev/uu_cp/struct.Attributes.html
@@ -1,4 +1,24 @@
-Attributes in uu_cp - Rust Struct uu_cp::Attributes
source · pub struct Attributes { /* private fields */ }
Trait Implementations§
Auto Trait Implementations§
§impl RefUnwindSafe for Attributes
§impl Send for Attributes
§impl Sync for Attributes
§impl Unpin for Attributes
§impl UnwindSafe for Attributes
Blanket Implementations§
source§impl<T> Any for Twhere
+Attributes in uu_cp - Rust Struct uu_cp::Attributes
source · pub struct Attributes {
+ pub ownership: Preserve,
+ pub mode: Preserve,
+ pub timestamps: Preserve,
+ pub context: Preserve,
+ pub links: Preserve,
+ pub xattr: Preserve,
+}
Expand description
Preservation settings for various attributes
+It should be derived from options as follows:
+
+- if there is a list of attributes to preserve (i.e.
--preserve=ATTR_LIST) parse that list with Attributes::parse_iter,
+- if
-p or --preserve is given without arguments, use Attributes::DEFAULT,
+- if
-a/--archive is passed, use Attributes::ALL,
+- if
-d is passed use Attributes::LINKS,
+- otherwise, use
Attributes::NONE.
+
+For full compatibility with GNU, these options should also combine. We
+currently only do a best effort imitation of that behavior, because it is
+difficult to achieve in clap, especially with --no-preserve.
+Fields§
§ownership: Preserve§mode: Preserve§timestamps: Preserve§context: Preserve§links: Preserve§xattr: PreserveImplementations§
Trait Implementations§
Auto Trait Implementations§
§impl RefUnwindSafe for Attributes
§impl Send for Attributes
§impl Sync for Attributes
§impl Unpin for Attributes
§impl UnwindSafe for Attributes
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/dev/uu_cp/struct.Options.html b/dev/uu_cp/struct.Options.html
index 3277a1cc8..74a9ba9d5 100644
--- a/dev/uu_cp/struct.Options.html
+++ b/dev/uu_cp/struct.Options.html
@@ -1,5 +1,74 @@
-Options in uu_cp - Rust pub struct Options { /* private fields */ }
Expand description
Re-usable, extensible copy options
-Auto Trait Implementations§
§impl RefUnwindSafe for Options
§impl Send for Options
§impl Sync for Options
§impl Unpin for Options
§impl UnwindSafe for Options
Blanket Implementations§
source§impl<T> Any for Twhere
+Options in uu_cp - Rust pub struct Options {Show 21 fields
+ pub attributes_only: bool,
+ pub backup: BackupMode,
+ pub copy_contents: bool,
+ pub cli_dereference: bool,
+ pub copy_mode: CopyMode,
+ pub dereference: bool,
+ pub no_target_dir: bool,
+ pub one_file_system: bool,
+ pub overwrite: OverwriteMode,
+ pub parents: bool,
+ pub sparse_mode: SparseMode,
+ pub strip_trailing_slashes: bool,
+ pub reflink_mode: ReflinkMode,
+ pub attributes: Attributes,
+ pub recursive: bool,
+ pub backup_suffix: String,
+ pub target_dir: Option<PathBuf>,
+ pub update: UpdateMode,
+ pub debug: bool,
+ pub verbose: bool,
+ pub progress_bar: bool,
+}
Expand description
Options for the cp command
+All options are public so that the options can be programmatically
+constructed by other crates, such as nushell. That means that this struct
+is part of our public API. It should therefore not be changed without good
+reason.
+The fields are documented with the arguments that determine their value.
+Fields§
§attributes_only: bool--attributes-only
+§backup: BackupMode--backup[=CONTROL], -b
+§copy_contents: bool--copy-contents
+§cli_dereference: bool-H
+§copy_mode: CopyModeDetermines the type of copying that should be done
+Set by the following arguments:
+
+-l, --link: CopyMode::Link
+-s, --symbolic-link: CopyMode::SymLink
+-u, --update[=WHEN]: CopyMode::Update
+--attributes-only: CopyMode::AttrOnly
+- otherwise:
CopyMode::Copy
+
+§dereference: bool-L, --dereference
+§no_target_dir: bool-T, --no-target-dir
+§one_file_system: bool-x, --one-file-system
+§overwrite: OverwriteModeSpecifies what to do with an existing destination
+Set by the following arguments:
+
+-i, --interactive: OverwriteMode::Interactive
+-n, --no-clobber: OverwriteMode::NoClobber
+- otherwise:
OverwriteMode::Clobber
+
+The Interactive and Clobber variants have a ClobberMode argument,
+set by the following arguments:
+
+-f, --force: ClobberMode::Force
+--remove-destination: ClobberMode::RemoveDestination
+- otherwise:
ClobberMode::Standard
+
+§parents: bool--parents
+§sparse_mode: SparseMode--sparse[=WHEN]
+§strip_trailing_slashes: bool--strip-trailing-slashes
+§reflink_mode: ReflinkMode--reflink[=WHEN]
+§attributes: Attributes--preserve=[=ATTRIBUTE_LIST] and --no-preserve=ATTRIBUTE_LIST
+§recursive: bool-R, -r, --recursive
+§backup_suffix: String-S, --suffix
+§target_dir: Option<PathBuf>-t, --target-directory
+§update: UpdateMode--update[=UPDATE]
+§debug: bool--debug
+§verbose: bool-v, --verbose
+§progress_bar: bool-g, --progress
+Auto Trait Implementations§
§impl RefUnwindSafe for Options
§impl Send for Options
§impl Sync for Options
§impl Unpin for Options
§impl UnwindSafe for Options
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/dev/uu_cp/type.CopyResult.html b/dev/uu_cp/type.CopyResult.html
index 26d072b6b..f4bf8dea8 100644
--- a/dev/uu_cp/type.CopyResult.html
+++ b/dev/uu_cp/type.CopyResult.html
@@ -1 +1 @@
-CopyResult in uu_cp - Rust Type Definition uu_cp::CopyResult
source · pub type CopyResult<T> = Result<T, Error>;
\ No newline at end of file
+CopyResult in uu_cp - Rust Type Definition uu_cp::CopyResult
source · pub type CopyResult<T> = Result<T, Error>;
\ No newline at end of file
diff --git a/dev/uu_cp/type.Source.html b/dev/uu_cp/type.Source.html
deleted file mode 100644
index 5915f1ab8..000000000
--- a/dev/uu_cp/type.Source.html
+++ /dev/null
@@ -1 +0,0 @@
-Source in uu_cp - Rust
\ No newline at end of file
diff --git a/dev/uu_cp/type.SourceSlice.html b/dev/uu_cp/type.SourceSlice.html
deleted file mode 100644
index b2f015966..000000000
--- a/dev/uu_cp/type.SourceSlice.html
+++ /dev/null
@@ -1 +0,0 @@
-SourceSlice in uu_cp - Rust Type Definition uu_cp::SourceSlice
source · pub type SourceSlice = Path;
\ No newline at end of file
diff --git a/dev/uu_cp/type.Target.html b/dev/uu_cp/type.Target.html
deleted file mode 100644
index 3f075dbac..000000000
--- a/dev/uu_cp/type.Target.html
+++ /dev/null
@@ -1 +0,0 @@
-Target in uu_cp - Rust
\ No newline at end of file
diff --git a/dev/uu_cp/type.TargetSlice.html b/dev/uu_cp/type.TargetSlice.html
deleted file mode 100644
index 8644bf1b8..000000000
--- a/dev/uu_cp/type.TargetSlice.html
+++ /dev/null
@@ -1 +0,0 @@
-TargetSlice in uu_cp - Rust Type Definition uu_cp::TargetSlice
source · pub type TargetSlice = Path;
\ No newline at end of file
diff --git a/dev/uu_nl/fn.uu_app.html b/dev/uu_nl/fn.uu_app.html
index 03de60e61..d17f6af5c 100644
--- a/dev/uu_nl/fn.uu_app.html
+++ b/dev/uu_nl/fn.uu_app.html
@@ -1 +1 @@
-uu_app in uu_nl - Rust
\ No newline at end of file
+uu_app in uu_nl - Rust
\ No newline at end of file
diff --git a/dev/uu_nl/fn.uumain.html b/dev/uu_nl/fn.uumain.html
index 245c9df3e..b8f61513a 100644
--- a/dev/uu_nl/fn.uumain.html
+++ b/dev/uu_nl/fn.uumain.html
@@ -1 +1 @@
-uumain in uu_nl - Rust
\ No newline at end of file
+uumain in uu_nl - Rust
\ No newline at end of file
diff --git a/dev/uu_nl/index.html b/dev/uu_nl/index.html
index fee19cce1..d7cbf8c00 100644
--- a/dev/uu_nl/index.html
+++ b/dev/uu_nl/index.html
@@ -1 +1 @@
-uu_nl - Rust
\ No newline at end of file
+uu_nl - Rust
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.BODY_NUMBERING.html b/dev/uu_nl/options/constant.BODY_NUMBERING.html
index 7bd8d075c..51e82a6b4 100644
--- a/dev/uu_nl/options/constant.BODY_NUMBERING.html
+++ b/dev/uu_nl/options/constant.BODY_NUMBERING.html
@@ -1 +1 @@
-BODY_NUMBERING in uu_nl::options - Rust Constant uu_nl::options::BODY_NUMBERING
source · pub const BODY_NUMBERING: &str = "body-numbering";
\ No newline at end of file
+BODY_NUMBERING in uu_nl::options - Rust Constant uu_nl::options::BODY_NUMBERING
source · pub const BODY_NUMBERING: &str = "body-numbering";
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.FILE.html b/dev/uu_nl/options/constant.FILE.html
index f0056ca01..b64a66d44 100644
--- a/dev/uu_nl/options/constant.FILE.html
+++ b/dev/uu_nl/options/constant.FILE.html
@@ -1 +1 @@
-FILE in uu_nl::options - Rust
\ No newline at end of file
+FILE in uu_nl::options - Rust
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.FOOTER_NUMBERING.html b/dev/uu_nl/options/constant.FOOTER_NUMBERING.html
index ff6a045e0..4108205c2 100644
--- a/dev/uu_nl/options/constant.FOOTER_NUMBERING.html
+++ b/dev/uu_nl/options/constant.FOOTER_NUMBERING.html
@@ -1 +1 @@
-FOOTER_NUMBERING in uu_nl::options - Rust Constant uu_nl::options::FOOTER_NUMBERING
source · pub const FOOTER_NUMBERING: &str = "footer-numbering";
\ No newline at end of file
+FOOTER_NUMBERING in uu_nl::options - Rust Constant uu_nl::options::FOOTER_NUMBERING
source · pub const FOOTER_NUMBERING: &str = "footer-numbering";
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.HEADER_NUMBERING.html b/dev/uu_nl/options/constant.HEADER_NUMBERING.html
index b4f7e0fd5..780b5859c 100644
--- a/dev/uu_nl/options/constant.HEADER_NUMBERING.html
+++ b/dev/uu_nl/options/constant.HEADER_NUMBERING.html
@@ -1 +1 @@
-HEADER_NUMBERING in uu_nl::options - Rust Constant uu_nl::options::HEADER_NUMBERING
source · pub const HEADER_NUMBERING: &str = "header-numbering";
\ No newline at end of file
+HEADER_NUMBERING in uu_nl::options - Rust Constant uu_nl::options::HEADER_NUMBERING
source · pub const HEADER_NUMBERING: &str = "header-numbering";
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.HELP.html b/dev/uu_nl/options/constant.HELP.html
index 2a83de2bf..91c6cb275 100644
--- a/dev/uu_nl/options/constant.HELP.html
+++ b/dev/uu_nl/options/constant.HELP.html
@@ -1 +1 @@
-HELP in uu_nl::options - Rust
\ No newline at end of file
+HELP in uu_nl::options - Rust
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.JOIN_BLANK_LINES.html b/dev/uu_nl/options/constant.JOIN_BLANK_LINES.html
index c56bb9339..fb02e62e8 100644
--- a/dev/uu_nl/options/constant.JOIN_BLANK_LINES.html
+++ b/dev/uu_nl/options/constant.JOIN_BLANK_LINES.html
@@ -1 +1 @@
-JOIN_BLANK_LINES in uu_nl::options - Rust Constant uu_nl::options::JOIN_BLANK_LINES
source · pub const JOIN_BLANK_LINES: &str = "join-blank-lines";
\ No newline at end of file
+JOIN_BLANK_LINES in uu_nl::options - Rust Constant uu_nl::options::JOIN_BLANK_LINES
source · pub const JOIN_BLANK_LINES: &str = "join-blank-lines";
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.LINE_INCREMENT.html b/dev/uu_nl/options/constant.LINE_INCREMENT.html
index 4e32a3a96..583e484bf 100644
--- a/dev/uu_nl/options/constant.LINE_INCREMENT.html
+++ b/dev/uu_nl/options/constant.LINE_INCREMENT.html
@@ -1 +1 @@
-LINE_INCREMENT in uu_nl::options - Rust Constant uu_nl::options::LINE_INCREMENT
source · pub const LINE_INCREMENT: &str = "line-increment";
\ No newline at end of file
+LINE_INCREMENT in uu_nl::options - Rust Constant uu_nl::options::LINE_INCREMENT
source · pub const LINE_INCREMENT: &str = "line-increment";
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.NO_RENUMBER.html b/dev/uu_nl/options/constant.NO_RENUMBER.html
index e657f6f40..aad0c29db 100644
--- a/dev/uu_nl/options/constant.NO_RENUMBER.html
+++ b/dev/uu_nl/options/constant.NO_RENUMBER.html
@@ -1 +1 @@
-NO_RENUMBER in uu_nl::options - Rust Constant uu_nl::options::NO_RENUMBER
source · pub const NO_RENUMBER: &str = "no-renumber";
\ No newline at end of file
+NO_RENUMBER in uu_nl::options - Rust Constant uu_nl::options::NO_RENUMBER
source · pub const NO_RENUMBER: &str = "no-renumber";
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.NUMBER_FORMAT.html b/dev/uu_nl/options/constant.NUMBER_FORMAT.html
index 1d895f36e..0bcc6f65b 100644
--- a/dev/uu_nl/options/constant.NUMBER_FORMAT.html
+++ b/dev/uu_nl/options/constant.NUMBER_FORMAT.html
@@ -1 +1 @@
-NUMBER_FORMAT in uu_nl::options - Rust Constant uu_nl::options::NUMBER_FORMAT
source · pub const NUMBER_FORMAT: &str = "number-format";
\ No newline at end of file
+NUMBER_FORMAT in uu_nl::options - Rust Constant uu_nl::options::NUMBER_FORMAT
source · pub const NUMBER_FORMAT: &str = "number-format";
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.NUMBER_SEPARATOR.html b/dev/uu_nl/options/constant.NUMBER_SEPARATOR.html
index 5b48f10f0..2b7da298e 100644
--- a/dev/uu_nl/options/constant.NUMBER_SEPARATOR.html
+++ b/dev/uu_nl/options/constant.NUMBER_SEPARATOR.html
@@ -1 +1 @@
-NUMBER_SEPARATOR in uu_nl::options - Rust Constant uu_nl::options::NUMBER_SEPARATOR
source · pub const NUMBER_SEPARATOR: &str = "number-separator";
\ No newline at end of file
+NUMBER_SEPARATOR in uu_nl::options - Rust Constant uu_nl::options::NUMBER_SEPARATOR
source · pub const NUMBER_SEPARATOR: &str = "number-separator";
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.NUMBER_WIDTH.html b/dev/uu_nl/options/constant.NUMBER_WIDTH.html
index a4bf5e57c..d7daac4f9 100644
--- a/dev/uu_nl/options/constant.NUMBER_WIDTH.html
+++ b/dev/uu_nl/options/constant.NUMBER_WIDTH.html
@@ -1 +1 @@
-NUMBER_WIDTH in uu_nl::options - Rust Constant uu_nl::options::NUMBER_WIDTH
source · pub const NUMBER_WIDTH: &str = "number-width";
\ No newline at end of file
+NUMBER_WIDTH in uu_nl::options - Rust Constant uu_nl::options::NUMBER_WIDTH
source · pub const NUMBER_WIDTH: &str = "number-width";
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.SECTION_DELIMITER.html b/dev/uu_nl/options/constant.SECTION_DELIMITER.html
index d965582c1..9f069ada5 100644
--- a/dev/uu_nl/options/constant.SECTION_DELIMITER.html
+++ b/dev/uu_nl/options/constant.SECTION_DELIMITER.html
@@ -1 +1 @@
-SECTION_DELIMITER in uu_nl::options - Rust Constant uu_nl::options::SECTION_DELIMITER
source · pub const SECTION_DELIMITER: &str = "section-delimiter";
\ No newline at end of file
+SECTION_DELIMITER in uu_nl::options - Rust Constant uu_nl::options::SECTION_DELIMITER
source · pub const SECTION_DELIMITER: &str = "section-delimiter";
\ No newline at end of file
diff --git a/dev/uu_nl/options/constant.STARTING_LINE_NUMBER.html b/dev/uu_nl/options/constant.STARTING_LINE_NUMBER.html
index 2c4be2f98..68e825d64 100644
--- a/dev/uu_nl/options/constant.STARTING_LINE_NUMBER.html
+++ b/dev/uu_nl/options/constant.STARTING_LINE_NUMBER.html
@@ -1 +1 @@
-STARTING_LINE_NUMBER in uu_nl::options - Rust Constant uu_nl::options::STARTING_LINE_NUMBER
source · pub const STARTING_LINE_NUMBER: &str = "starting-line-number";
\ No newline at end of file
+STARTING_LINE_NUMBER in uu_nl::options - Rust Constant uu_nl::options::STARTING_LINE_NUMBER
source · pub const STARTING_LINE_NUMBER: &str = "starting-line-number";
\ No newline at end of file
diff --git a/dev/uu_nl/options/index.html b/dev/uu_nl/options/index.html
index 99f870905..f7dc4ee13 100644
--- a/dev/uu_nl/options/index.html
+++ b/dev/uu_nl/options/index.html
@@ -1 +1 @@
-uu_nl::options - Rust
\ No newline at end of file
+uu_nl::options - Rust
\ No newline at end of file