From 64cb591e3b18ec4fd8abf29e507149ec21a6cb93 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Tue, 6 Feb 2024 13:45:12 +0100 Subject: [PATCH 1/2] seq: fix about text not found --- src/uu/seq/seq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uu/seq/seq.md b/src/uu/seq/seq.md index 8e67391e48..d747e4a026 100644 --- a/src/uu/seq/seq.md +++ b/src/uu/seq/seq.md @@ -1,9 +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 ``` + +Display numbers from FIRST to LAST, in steps of INCREMENT. From 0b89a734b6c8e7edf1acb4aa6171cb50d2a47497 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Tue, 6 Feb 2024 13:45:43 +0100 Subject: [PATCH 2/2] uucore: make help_{about,usage} fail if no text is found --- src/uucore_procs/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/uucore_procs/src/lib.rs b/src/uucore_procs/src/lib.rs index cbe915936d..dfd8b88f63 100644 --- a/src/uucore_procs/src/lib.rs +++ b/src/uucore_procs/src/lib.rs @@ -63,6 +63,9 @@ pub fn help_about(input: TokenStream) -> TokenStream { let input: Vec = input.into_iter().collect(); let filename = get_argument(&input, 0, "filename"); let text: String = uuhelp_parser::parse_about(&read_help(&filename)); + if text.is_empty() { + panic!("About text not found! Make sure the markdown format is correct"); + } TokenTree::Literal(Literal::string(&text)).into() } @@ -77,6 +80,9 @@ pub fn help_usage(input: TokenStream) -> TokenStream { let input: Vec = input.into_iter().collect(); let filename = get_argument(&input, 0, "filename"); let text: String = uuhelp_parser::parse_usage(&read_help(&filename)); + if text.is_empty() { + panic!("Usage text not found! Make sure the markdown format is correct"); + } TokenTree::Literal(Literal::string(&text)).into() }