From 3ca1fa8dfd207dffa209ea464f6e56dbf27149da Mon Sep 17 00:00:00 2001 From: m11o Date: Fri, 28 Apr 2023 20:21:44 +0900 Subject: [PATCH] sum: move help strings to markdown file --- src/uu/sum/src/sum.rs | 7 +++---- src/uu/sum/sum.md | 9 +++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 src/uu/sum/sum.md diff --git a/src/uu/sum/src/sum.rs b/src/uu/sum/src/sum.rs index 1134f2444..0ea415b13 100644 --- a/src/uu/sum/src/sum.rs +++ b/src/uu/sum/src/sum.rs @@ -13,11 +13,10 @@ use std::io::{stdin, Read}; use std::path::Path; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError}; -use uucore::{format_usage, show}; +use uucore::{format_usage, help_about, help_usage, show}; -static USAGE: &str = "{} [OPTION]... [FILE]..."; -static ABOUT: &str = "Checksum and count the blocks in a file.\n\n\ - With no FILE, or when FILE is -, read standard input."; +const USAGE: &str = help_usage!("sum.md"); +const ABOUT: &str = help_about!("sum.md"); // This can be replaced with usize::div_ceil once it is stabilized. // This implementation approach is optimized for when `b` is a constant, diff --git a/src/uu/sum/sum.md b/src/uu/sum/sum.md new file mode 100644 index 000000000..ca3adb81f --- /dev/null +++ b/src/uu/sum/sum.md @@ -0,0 +1,9 @@ +# sum + +``` +sum [OPTION]... [FILE]..." +``` + +Checksum and count the blocks in a file. + +With no FILE, or when FILE is -, read standard input.