Repository: nushell/nushell
File: crates/nu-command/src/filesystem/ucp.rs (Rust)

Code before:
    }

    fn description(&self) -> &str {
        "Copy files using uutils/coreutils cp."
    }

    fn search_terms(&self) -> Vec<&str> {
        vec!["copy", "file", "files", "coreutils"]
    }

    fn signature(&self) -> Signature {
        Signature::build("cp")
            .input_output_types(vec![(Type::Nothing, Type::Nothing)])
            .switch("recursive", "Copy directories recursively.", Some('r'))
            .switch("verbose", "Explicitly state what is being done.", Some('v'))
            .switch(
                "force",
                "if an existing destination file cannot be opened, remove it and try
                    again (this option is ignored when the -n option is also used).
                    currently not implemented for windows",
                Some('f'),
            )
            .switch("interactive", "Ask before overwriting files.", Some('i'))
            .switch(
                "update",
                "copy only when the SOURCE file is newer than the destination file or when the destination file is missing",
                Some('u')
            )
            .switch("progress", "Display a progress bar.", Some('p'))
            .switch("no-clobber", "Do not overwrite an existing file.", Some('n'))
            .named(
                "preserve",
                SyntaxShape::List(Box::new(SyntaxShape::String)),
                "preserve only the specified attributes (empty list means no attributes preserved)
                    if not specified only mode is preserved
                    possible values: mode, ownership (unix only), timestamps, context, link, links, xattr",
                None
            )
            .switch("debug", "Explain how a file is copied. Implies -v.", None)
            .switch("all", "Copy hidden files if '*' is provided.", Some('a'))
            .rest("paths", SyntaxShape::OneOf(vec![SyntaxShape::GlobPattern, SyntaxShape::String]), "Copy SRC file/s to DEST.")
            .allow_variants_without_examples(true)
            .category(Category::FileSystem)
    }

    fn examples(&self) -> Vec<Example<'_>> {
        vec![
            Example {
                description: "Copy myfile to dir_b.",
                example: "cp myfile dir_b",
                result: None,

Review comment (suggestion):
```suggestion
                "Copy only when the SOURCE file is newer than the destination file or when the destination file is missing.",
```

Code after:
    }

    fn description(&self) -> &str {
        "Copy files using uutils/coreutils cp."
    }

    fn search_terms(&self) -> Vec<&str> {
        vec!["copy", "file", "files", "coreutils"]
    }

    fn signature(&self) -> Signature {
        Signature::build("cp")
            .input_output_types(vec![(Type::Nothing, Type::Nothing)])
            .switch("recursive", "Copy directories recursively.", Some('r'))
            .switch("verbose", "Explicitly state what is being done.", Some('v'))
            .switch(
                "force",
                "if an existing destination file cannot be opened, remove it and try
                    again (this option is ignored when the -n option is also used).
                    currently not implemented for windows",
                Some('f'),
            )
            .switch("interactive", "Ask before overwriting files.", Some('i'))
            .switch(
                "update",
                "Copy only when the SOURCE file is newer than the destination file or when the destination file is missing.",
                Some('u')
            )
            .switch("progress", "Display a progress bar.", Some('p'))
            .switch("no-clobber", "Do not overwrite an existing file.", Some('n'))
            .named(
                "preserve",
                SyntaxShape::List(Box::new(SyntaxShape::String)),
                "Preserve only the specified attributes (empty list means no attributes preserved)
                    if not specified only mode is preserved
                    possible values: mode, ownership (unix only), timestamps, context, link, links, xattr",
                None
            )
            .switch("debug", "Explain how a file is copied. Implies -v.", None)
            .switch("all", "Copy hidden files if '*' is provided.", Some('a'))
            .rest("paths", SyntaxShape::OneOf(vec![SyntaxShape::GlobPattern, SyntaxShape::String]), "Copy SRC file/s to DEST.")
            .allow_variants_without_examples(true)
            .category(Category::FileSystem)
    }

    fn examples(&self) -> Vec<Example<'_>> {
        vec![
            Example {
                description: "Copy myfile to dir_b.",
                example: "cp myfile dir_b",
                result: None,