diff --git a/src/uu/du/du.md b/src/uu/du/du.md new file mode 100644 index 000000000..6f154d047 --- /dev/null +++ b/src/uu/du/du.md @@ -0,0 +1,24 @@ +# du + +``` +du [OPTION]... [FILE]... +du [OPTION]... --files0-from=F +``` + +Estimate file space usage + +## After Help + +Display values are in units of the first available SIZE from --block-size, +and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables. +Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set). + +SIZE is an integer and optional unit (example: 10M is 10*1024*1024). +Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB,... (powers +of 1000). + +PATTERN allows some advanced exclusions. For example, the following syntaxes +are supported: +? will match only one character +* will match zero or more characters +{a,b} will match a or b diff --git a/src/uu/du/src/du.rs b/src/uu/du/src/du.rs index a204adf4d..c35bbf119 100644 --- a/src/uu/du/src/du.rs +++ b/src/uu/du/src/du.rs @@ -36,7 +36,9 @@ use uucore::error::FromIo; use uucore::error::{UError, UResult}; use uucore::parse_glob; use uucore::parse_size::{parse_size, ParseSizeError}; -use uucore::{crash, format_usage, show, show_error, show_warning}; +use uucore::{ + crash, format_usage, help_about, help_section, help_usage, show, show_error, show_warning, +}; #[cfg(windows)] use windows_sys::Win32::Foundation::HANDLE; #[cfg(windows)] @@ -73,25 +75,9 @@ mod options { pub const FILE: &str = "FILE"; } -const ABOUT: &str = "Estimate file space usage"; -const LONG_HELP: &str = " -Display values are in units of the first available SIZE from --block-size, -and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables. -Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set). - -SIZE is an integer and optional unit (example: 10M is 10*1024*1024). -Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB,... (powers -of 1000). - -PATTERN allows some advanced exclusions. For example, the following syntaxes -are supported: -? will match only one character -* will match zero or more characters -{a,b} will match a or b -"; -const USAGE: &str = "\ - {} [OPTION]... [FILE]... - {} [OPTION]... --files0-from=F"; +const ABOUT: &str = help_about!("du.md"); +const AFTER_HELP: &str = help_section!("after help", "du.md"); +const USAGE: &str = help_usage!("du.md"); // TODO: Support Z & Y (currently limited by size of u64) const UNITS: [(char, u32); 6] = [('E', 6), ('P', 5), ('T', 4), ('G', 3), ('M', 2), ('K', 1)]; @@ -705,7 +691,7 @@ pub fn uu_app() -> Command { Command::new(uucore::util_name()) .version(crate_version!()) .about(ABOUT) - .after_help(LONG_HELP) + .after_help(AFTER_HELP) .override_usage(format_usage(USAGE)) .infer_long_args(true) .disable_help_flag(true)