From 07c0d9cad98d7112c7c789207dcd23a5e9a29356 Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Mon, 27 Mar 2023 11:09:19 +0200 Subject: [PATCH 1/2] paste: move help strings to markdown file --- src/uu/paste/paste.md | 8 ++++++++ src/uu/paste/src/paste.rs | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 src/uu/paste/paste.md diff --git a/src/uu/paste/paste.md b/src/uu/paste/paste.md new file mode 100644 index 000000000..26744cbfb --- /dev/null +++ b/src/uu/paste/paste.md @@ -0,0 +1,8 @@ +# paste + +``` +paste [OPTIONS] [FILE]... +``` + +Write lines consisting of the sequentially corresponding lines from each +`FILE`, separated by `TABs`, to standard output. diff --git a/src/uu/paste/src/paste.rs b/src/uu/paste/src/paste.rs index 3635ae967..d7a4d325c 100644 --- a/src/uu/paste/src/paste.rs +++ b/src/uu/paste/src/paste.rs @@ -13,9 +13,10 @@ use std::fs::File; use std::io::{stdin, stdout, BufRead, BufReader, Read, Write}; use std::path::Path; use uucore::error::{FromIo, UResult}; +use uucore::{format_usage, help_about, help_usage}; -static ABOUT: &str = "Write lines consisting of the sequentially corresponding lines from each -FILE, separated by TABs, to standard output."; +const ABOUT: &str = help_about!("paste.md"); +const USAGE: &str = help_usage!("paste.md"); mod options { pub const DELIMITER: &str = "delimiters"; @@ -76,6 +77,7 @@ pub fn uu_app() -> Command { Command::new(uucore::util_name()) .version(crate_version!()) .about(ABOUT) + .override_usage(format_usage(USAGE)) .infer_long_args(true) .arg( Arg::new(options::SERIAL) From d81ce37a4d50f0e0e7866b7f016b07ef151e325e Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Mon, 27 Mar 2023 11:41:08 +0200 Subject: [PATCH 2/2] paste: move backtick --- src/uu/paste/paste.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/paste/paste.md b/src/uu/paste/paste.md index 26744cbfb..741605888 100644 --- a/src/uu/paste/paste.md +++ b/src/uu/paste/paste.md @@ -5,4 +5,4 @@ paste [OPTIONS] [FILE]... ``` Write lines consisting of the sequentially corresponding lines from each -`FILE`, separated by `TABs`, to standard output. +`FILE`, separated by `TAB`s, to standard output.