diff --git a/src/uu/chmod/chmod.md b/src/uu/chmod/chmod.md new file mode 100644 index 000000000..d6c2ed2d8 --- /dev/null +++ b/src/uu/chmod/chmod.md @@ -0,0 +1,16 @@ + + +# chmod + +``` +chmod [OPTION]... MODE[,MODE]... FILE... +chmod [OPTION]... OCTAL-MODE FILE... +chmod [OPTION]... --reference=RFILE FILE... +``` + +Change the mode of each FILE to MODE. +With --reference, change the mode of each FILE to that of RFILE. + +## After Help + +Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=]?[0-7]+'. diff --git a/src/uu/chmod/src/chmod.rs b/src/uu/chmod/src/chmod.rs index dee26ab69..ec92d4bac 100644 --- a/src/uu/chmod/src/chmod.rs +++ b/src/uu/chmod/src/chmod.rs @@ -17,16 +17,11 @@ use uucore::fs::display_permissions_unix; use uucore::libc::mode_t; #[cfg(not(windows))] use uucore::mode; -use uucore::{format_usage, show, show_error}; +use uucore::{format_usage, help_about, help_section, help_usage, show, show_error}; -const ABOUT: &str = "Change the mode of each FILE to MODE.\n\ - With --reference, change the mode of each FILE to that of RFILE."; -const USAGE: &str = "\ - {} [OPTION]... MODE[,MODE]... FILE... - {} [OPTION]... OCTAL-MODE FILE... - {} [OPTION]... --reference=RFILE FILE..."; -const LONG_USAGE: &str = - "Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=]?[0-7]+'."; +const ABOUT: &str = help_about!("chmod.md"); +const USAGE: &str = help_usage!("chmod.md"); +const LONG_USAGE: &str = help_section!("after help", "chmod.md"); mod options { pub const CHANGES: &str = "changes";