From fd02bd13a1807a33701cf9ad96d9621480d6f633 Mon Sep 17 00:00:00 2001 From: m11o Date: Mon, 24 Apr 2023 23:35:52 +0900 Subject: [PATCH 1/3] seq: move help strings to md file --- src/uu/seq/seq.md | 9 +++++++++ src/uu/seq/src/seq.rs | 10 ++++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 src/uu/seq/seq.md diff --git a/src/uu/seq/seq.md b/src/uu/seq/seq.md new file mode 100644 index 000000000..065404e20 --- /dev/null +++ b/src/uu/seq/seq.md @@ -0,0 +1,9 @@ +# seq + +Display numbers from FIRST to LAST, in steps of INCREMENT. + +``` +seq [OPTION]... LAST +seq [OPTION]... FIRST LAST +seq [OPTION]... FIRST INCREMENT LAST"; +``` diff --git a/src/uu/seq/src/seq.rs b/src/uu/seq/src/seq.rs index 40bac8449..3e42e1708 100644 --- a/src/uu/seq/src/seq.rs +++ b/src/uu/seq/src/seq.rs @@ -12,9 +12,9 @@ use num_traits::Zero; use uucore::error::FromIo; use uucore::error::UResult; -use uucore::format_usage; use uucore::memo::printf; use uucore::show; +use uucore::{format_usage, help_about, help_usage}; mod error; mod extendedbigdecimal; @@ -27,11 +27,9 @@ use crate::extendedbigint::ExtendedBigInt; use crate::number::Number; use crate::number::PreciseNumber; -static ABOUT: &str = "Display numbers from FIRST to LAST, in steps of INCREMENT."; -const USAGE: &str = "\ - {} [OPTION]... LAST - {} [OPTION]... FIRST LAST - {} [OPTION]... FIRST INCREMENT LAST"; +const ABOUT: &str = help_about!("seq.md"); +const USAGE: &str = help_usage!("seq.md"); + static OPT_SEPARATOR: &str = "separator"; static OPT_TERMINATOR: &str = "terminator"; static OPT_WIDTHS: &str = "widths"; From 1cb0a673a0c4791688dd1fa101eff5bc6e4a80cc Mon Sep 17 00:00:00 2001 From: m11o Date: Mon, 24 Apr 2023 23:38:45 +0900 Subject: [PATCH 2/3] change static keyword to const keyword --- src/uu/seq/src/seq.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/uu/seq/src/seq.rs b/src/uu/seq/src/seq.rs index 3e42e1708..e48d22bd9 100644 --- a/src/uu/seq/src/seq.rs +++ b/src/uu/seq/src/seq.rs @@ -30,12 +30,12 @@ use crate::number::PreciseNumber; const ABOUT: &str = help_about!("seq.md"); const USAGE: &str = help_usage!("seq.md"); -static OPT_SEPARATOR: &str = "separator"; -static OPT_TERMINATOR: &str = "terminator"; -static OPT_WIDTHS: &str = "widths"; -static OPT_FORMAT: &str = "format"; +const OPT_SEPARATOR: &str = "separator"; +const OPT_TERMINATOR: &str = "terminator"; +const OPT_WIDTHS: &str = "widths"; +const OPT_FORMAT: &str = "format"; -static ARG_NUMBERS: &str = "numbers"; +const ARG_NUMBERS: &str = "numbers"; #[derive(Clone)] struct SeqOptions<'a> { From dd89ec709b39d9ec522c14a3267c2481edd88172 Mon Sep 17 00:00:00 2001 From: m11o Date: Mon, 24 Apr 2023 23:44:28 +0900 Subject: [PATCH 3/3] remove todo comment `-f` option is implemented in #2918 --- src/uu/seq/src/seq.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/uu/seq/src/seq.rs b/src/uu/seq/src/seq.rs index e48d22bd9..97382ed1b 100644 --- a/src/uu/seq/src/seq.rs +++ b/src/uu/seq/src/seq.rs @@ -2,7 +2,6 @@ // * // * For the full copyright and license information, please view the LICENSE // * file that was distributed with this source code. -// TODO: Support -f flag // spell-checker:ignore (ToDO) istr chiter argptr ilen extendedbigdecimal extendedbigint numberparse use std::io::{stdout, ErrorKind, Write}; use std::process::exit;