diff --git a/src/uu/cp/cp.md b/src/uu/cp/cp.md new file mode 100644 index 000000000..3659423ff --- /dev/null +++ b/src/uu/cp/cp.md @@ -0,0 +1,12 @@ +# cp + +## Usage +``` +cp [OPTION]... [-T] SOURCE DEST +cp [OPTION]... SOURCE... DIRECTORY +cp [OPTION]... -t DIRECTORY SOURCE... +``` + +## About + +Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index 1b7d58d06..a41ef836b 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -40,7 +40,7 @@ use uucore::error::{set_exit_code, UClapError, UError, UResult, UUsageError}; use uucore::fs::{ canonicalize, paths_refer_to_same_file, FileInformation, MissingHandling, ResolveMode, }; -use uucore::{crash, format_usage, prompt_yes, show_error, show_warning}; +use uucore::{crash, format_usage, help_section, help_usage, prompt_yes, show_error, show_warning}; use crate::copydir::copy_directory; @@ -228,13 +228,10 @@ pub struct Options { progress_bar: bool, } -static ABOUT: &str = "Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY."; +const ABOUT: &str = help_section!("about", "cp.md"); static EXIT_ERR: i32 = 1; -const USAGE: &str = "\ - {} [OPTION]... [-T] SOURCE DEST - {} [OPTION]... SOURCE... DIRECTORY - {} [OPTION]... -t DIRECTORY SOURCE..."; +const USAGE: &str = help_usage!("cp.md"); // Argument constants mod options {