From 7cfeba0d22e60a8b69ad690635cef02fcdd8f6d2 Mon Sep 17 00:00:00 2001 From: Cheng-Hao Date: Mon, 20 Feb 2023 16:29:20 -0800 Subject: [PATCH] mkdir: move help strings to markdown file --- src/uu/mkdir/mkdir.md | 11 +++++++++++ src/uu/mkdir/src/mkdir.rs | 9 ++++----- 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 src/uu/mkdir/mkdir.md diff --git a/src/uu/mkdir/mkdir.md b/src/uu/mkdir/mkdir.md new file mode 100644 index 000000000..79deafc46 --- /dev/null +++ b/src/uu/mkdir/mkdir.md @@ -0,0 +1,11 @@ +# mkdir + +``` +mkdir [OPTION]... [USER] +``` + +Create the given DIRECTORY(ies) if they do not exist + +## Long Usage + +Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=]?[0-7]+'. diff --git a/src/uu/mkdir/src/mkdir.rs b/src/uu/mkdir/src/mkdir.rs index 9aced8ba5..ab92e7e74 100644 --- a/src/uu/mkdir/src/mkdir.rs +++ b/src/uu/mkdir/src/mkdir.rs @@ -18,14 +18,13 @@ use uucore::error::{UResult, USimpleError}; #[cfg(not(windows))] use uucore::mode; use uucore::{display::Quotable, fs::dir_strip_dot_for_creation}; -use uucore::{format_usage, show, show_if_err}; +use uucore::{format_usage, help_about, help_section, help_usage, show, show_if_err}; static DEFAULT_PERM: u32 = 0o755; -const ABOUT: &str = "Create the given DIRECTORY(ies) if they do not exist"; -const USAGE: &str = "{} [OPTION]... [USER]"; -const LONG_USAGE: &str = - "Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=]?[0-7]+'."; +const ABOUT: &str = help_about!("mkdir.md"); +const USAGE: &str = help_usage!("mkdir.md"); +const LONG_USAGE: &str = help_section!("long usage", "mkdir.md"); mod options { pub const MODE: &str = "mode";