mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 23:02:38 +00:00
cp: move after help to md file
This commit is contained in:
parent
78412c5a61
commit
2f975e913e
2 changed files with 23 additions and 3 deletions
|
@ -7,3 +7,19 @@ cp [OPTION]... -t DIRECTORY SOURCE...
|
|||
```
|
||||
|
||||
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
|
||||
|
||||
## After Help
|
||||
|
||||
Do not copy a non-directory that has an existing destination with the same or newer modification timestamp;
|
||||
instead, silently skip the file without failing. If timestamps are being preserved, the comparison is to the
|
||||
source timestamp truncated to the resolutions of the destination file system and of the system calls used to
|
||||
update timestamps; this avoids duplicate work if several ‘cp -pu’ commands are executed with the same source
|
||||
and destination. This option is ignored if the -n or --no-clobber option is also specified. Also, if
|
||||
--preserve=links is also specified (like with ‘cp -au’ for example), that will take precedence; consequently,
|
||||
depending on the order that files are processed from the source, newer files in the destination may be replaced,
|
||||
to mirror hard links in the source. which gives more control over which existing files in the destination are
|
||||
replaced, and its value can be one of the following:
|
||||
|
||||
all This is the default operation when an --update option is not specified, and results in all existing files in the destination being replaced.
|
||||
none This is similar to the --no-clobber option, in that no files in the destination are replaced, but also skipping a file does not induce a failure.
|
||||
older This is the default operation when --update is specified, and results in files being replaced if they’re older than the corresponding source file.
|
||||
|
|
|
@ -41,7 +41,9 @@ use uucore::fs::{
|
|||
canonicalize, paths_refer_to_same_file, FileInformation, MissingHandling, ResolveMode,
|
||||
};
|
||||
use uucore::update_control::{self, UpdateMode};
|
||||
use uucore::{crash, format_usage, help_about, help_usage, prompt_yes, show_error, show_warning};
|
||||
use uucore::{
|
||||
crash, format_usage, help_about, help_section, help_usage, prompt_yes, show_error, show_warning,
|
||||
};
|
||||
|
||||
use crate::copydir::copy_directory;
|
||||
|
||||
|
@ -232,6 +234,7 @@ pub struct Options {
|
|||
|
||||
const ABOUT: &str = help_about!("cp.md");
|
||||
const USAGE: &str = help_usage!("cp.md");
|
||||
const AFTER_HELP: &str = help_section!("after help", "cp.md");
|
||||
|
||||
static EXIT_ERR: i32 = 1;
|
||||
|
||||
|
@ -310,9 +313,8 @@ pub fn uu_app() -> Command {
|
|||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.override_usage(format_usage(USAGE))
|
||||
.after_help(AFTER_HELP)
|
||||
.infer_long_args(true)
|
||||
.arg(update_control::arguments::update())
|
||||
.arg(update_control::arguments::update_no_args())
|
||||
.arg(
|
||||
Arg::new(options::TARGET_DIRECTORY)
|
||||
.short('t')
|
||||
|
@ -410,6 +412,8 @@ pub fn uu_app() -> Command {
|
|||
.arg(backup_control::arguments::backup())
|
||||
.arg(backup_control::arguments::backup_no_args())
|
||||
.arg(backup_control::arguments::suffix())
|
||||
.arg(update_control::arguments::update())
|
||||
.arg(update_control::arguments::update_no_args())
|
||||
.arg(
|
||||
Arg::new(options::REFLINK)
|
||||
.long(options::REFLINK)
|
||||
|
|
Loading…
Reference in a new issue