From d96aa3e0980928d66c3df65b65bd91d325695a14 Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Thu, 23 Mar 2023 14:07:12 +0100 Subject: [PATCH 1/3] more: move help strings to markdown file --- src/uu/more/more.md | 7 +++++++ src/uu/more/src/more.rs | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/uu/more/more.md diff --git a/src/uu/more/more.md b/src/uu/more/more.md new file mode 100644 index 00000000000..588ed1ab45b --- /dev/null +++ b/src/uu/more/more.md @@ -0,0 +1,7 @@ +# more + +``` +more [OPTIONS] ... +``` + +A file perusal filter for CRT viewing. diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs index 31b1640a258..4dc8a3db625 100644 --- a/src/uu/more/src/more.rs +++ b/src/uu/more/src/more.rs @@ -28,8 +28,11 @@ use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; use uucore::display::Quotable; use uucore::error::{UResult, USimpleError, UUsageError}; +use uucore::{format_usage, help_about, help_usage}; +const ABOUT: &str = help_about!("more.md"); const BELL: &str = "\x07"; +const USAGE: &str = help_usage!("more.md"); pub mod options { pub const SILENT: &str = "silent"; @@ -97,7 +100,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { pub fn uu_app() -> Command { Command::new(uucore::util_name()) - .about("A file perusal filter for CRT viewing.") + .about(ABOUT) + .override_usage(format_usage(USAGE)) .version(crate_version!()) .infer_long_args(true) .arg( From 6c9664433ff3341ada8e09df99a08415739c0b39 Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Thu, 23 Mar 2023 16:09:04 +0100 Subject: [PATCH 2/3] more: group about and usage --- src/uu/more/src/more.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs index 4dc8a3db625..6cf9df1ab12 100644 --- a/src/uu/more/src/more.rs +++ b/src/uu/more/src/more.rs @@ -31,8 +31,8 @@ use uucore::error::{UResult, USimpleError, UUsageError}; use uucore::{format_usage, help_about, help_usage}; const ABOUT: &str = help_about!("more.md"); -const BELL: &str = "\x07"; const USAGE: &str = help_usage!("more.md"); +const BELL: &str = "\x07"; pub mod options { pub const SILENT: &str = "silent"; From d4758ff3c86ed687466663785b62e3bb765ba65d Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Thu, 23 Mar 2023 18:44:03 +0100 Subject: [PATCH 3/3] more: modernize about section --- src/uu/more/more.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uu/more/more.md b/src/uu/more/more.md index 588ed1ab45b..cb626060ec5 100644 --- a/src/uu/more/more.md +++ b/src/uu/more/more.md @@ -4,4 +4,5 @@ more [OPTIONS] ... ``` -A file perusal filter for CRT viewing. +Display the contents of a text file +