From 2bae3dd4f2c49ad44972df83bd2740ef36415dc6 Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 16:29:43 +0100 Subject: [PATCH 1/5] wc: move help strings to markdown file --- src/uu/wc/src/wc.rs | 7 +++---- src/uu/wc/wc.md | 9 +++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 src/uu/wc/wc.md diff --git a/src/uu/wc/src/wc.rs b/src/uu/wc/src/wc.rs index 4a4838350..21c4643c6 100644 --- a/src/uu/wc/src/wc.rs +++ b/src/uu/wc/src/wc.rs @@ -15,7 +15,7 @@ use count_fast::{count_bytes_chars_and_lines_fast, count_bytes_fast}; use countable::WordCountable; use unicode_width::UnicodeWidthChar; use utf8::{BufReadDecoder, BufReadDecoderError}; -use uucore::{format_usage, show}; +use uucore::{format_usage, show, help_about, help_usage}; use word_count::{TitledWordCount, WordCount}; use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; @@ -98,9 +98,8 @@ impl Settings { } } -static ABOUT: &str = "Display newline, word, and byte counts for each FILE, and a total line if -more than one FILE is specified. With no FILE, or when FILE is -, read standard input."; -const USAGE: &str = "{} [OPTION]... [FILE]..."; +static ABOUT: &str = help_about!("wc.md"); +const USAGE: &str = help_usage!("wc.md"); pub mod options { pub static BYTES: &str = "bytes"; diff --git a/src/uu/wc/wc.md b/src/uu/wc/wc.md new file mode 100644 index 000000000..f1b243606 --- /dev/null +++ b/src/uu/wc/wc.md @@ -0,0 +1,9 @@ +# wc + +## Usage +``` +wc [OPTION]... [FILE]... +``` + +Display newline, word, and byte counts for each FILE, and a total line if +more than one FILE is specified. With no FILE, or when FILE is -, read standard input. From 427611122229b08cb3f8f74ac318a36dceb82f0f Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 18:10:53 +0100 Subject: [PATCH 2/5] change ABOUT from static to const --- src/uu/wc/src/wc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/wc/src/wc.rs b/src/uu/wc/src/wc.rs index 21c4643c6..c1f4a2db1 100644 --- a/src/uu/wc/src/wc.rs +++ b/src/uu/wc/src/wc.rs @@ -98,7 +98,7 @@ impl Settings { } } -static ABOUT: &str = help_about!("wc.md"); +const ABOUT: &str = help_about!("wc.md"); const USAGE: &str = help_usage!("wc.md"); pub mod options { From 4bae3e0cd977f60a2cc17cc5ca483db4ed7d17c6 Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 18:14:10 +0100 Subject: [PATCH 3/5] remove redundant line --- src/uu/wc/wc.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uu/wc/wc.md b/src/uu/wc/wc.md index f1b243606..db470a423 100644 --- a/src/uu/wc/wc.md +++ b/src/uu/wc/wc.md @@ -1,7 +1,6 @@ # wc -## Usage -``` +```sh wc [OPTION]... [FILE]... ``` From aead80efdbb5e87f2ba72817599a142212099ffb Mon Sep 17 00:00:00 2001 From: Alexander Kunde Date: Thu, 2 Mar 2023 18:55:11 +0100 Subject: [PATCH 4/5] cargo fmt --- src/uu/wc/src/wc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/wc/src/wc.rs b/src/uu/wc/src/wc.rs index c1f4a2db1..0b7b164a8 100644 --- a/src/uu/wc/src/wc.rs +++ b/src/uu/wc/src/wc.rs @@ -15,7 +15,7 @@ use count_fast::{count_bytes_chars_and_lines_fast, count_bytes_fast}; use countable::WordCountable; use unicode_width::UnicodeWidthChar; use utf8::{BufReadDecoder, BufReadDecoderError}; -use uucore::{format_usage, show, help_about, help_usage}; +use uucore::{format_usage, help_about, help_usage, show}; use word_count::{TitledWordCount, WordCount}; use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; From 2085d4d4ab1ec1ca977129466c2872ff8fc8728f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 3 Mar 2023 13:52:47 +0100 Subject: [PATCH 5/5] remove the sh in the syntax --- src/uu/wc/wc.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/uu/wc/wc.md b/src/uu/wc/wc.md index db470a423..3d0014b37 100644 --- a/src/uu/wc/wc.md +++ b/src/uu/wc/wc.md @@ -1,6 +1,5 @@ # wc -```sh wc [OPTION]... [FILE]... ```