From 540435806c1e222418bd644414e5d60bf9d1322b Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Thu, 23 Mar 2023 10:44:29 +0100 Subject: [PATCH 1/2] join: move help strings to markdown file --- src/uu/join/join.md | 10 ++++++++++ src/uu/join/src/join.rs | 13 ++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 src/uu/join/join.md diff --git a/src/uu/join/join.md b/src/uu/join/join.md new file mode 100644 index 000000000..d2e5a5413 --- /dev/null +++ b/src/uu/join/join.md @@ -0,0 +1,10 @@ +# join + +``` +[OPTIONS] +``` + +For each pair of input lines with identical join fields, write a line to +standard output. The default join field is the first, delimited by blanks. + +When `FILE1` or `FILE2` (not both) is `-`, read standard input. diff --git a/src/uu/join/src/join.rs b/src/uu/join/src/join.rs index ffcf6fdcd..baf70c259 100644 --- a/src/uu/join/src/join.rs +++ b/src/uu/join/src/join.rs @@ -22,7 +22,10 @@ use std::num::IntErrorKind; use std::os::unix::ffi::OsStrExt; use uucore::display::Quotable; use uucore::error::{set_exit_code, UError, UResult, USimpleError}; -use uucore::{crash, crash_if_err}; +use uucore::{crash, crash_if_err, format_usage, help_about, help_usage}; + +const ABOUT: &str = help_about!("join.md"); +const USAGE: &str = help_usage!("join.md"); #[derive(Debug)] enum JoinError { @@ -699,12 +702,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { pub fn uu_app() -> Command { Command::new(uucore::util_name()) .version(crate_version!()) - .about( - "For each pair of input lines with identical join fields, write a line to -standard output. The default join field is the first, delimited by blanks. - -When FILE1 or FILE2 (not both) is -, read standard input.", - ) + .about(ABOUT) + .override_usage(format_usage(USAGE)) .infer_long_args(true) .arg( Arg::new("a") From c51e0db35fbbe9b0bd5933b9deaa4f5db83eab13 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Thu, 23 Mar 2023 13:38:27 +0100 Subject: [PATCH 2/2] join: add missing "join" to markdown file --- src/uu/join/join.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/join/join.md b/src/uu/join/join.md index d2e5a5413..ec91950b8 100644 --- a/src/uu/join/join.md +++ b/src/uu/join/join.md @@ -1,7 +1,7 @@ # join ``` -[OPTIONS] +join [OPTIONS] ``` For each pair of input lines with identical join fields, write a line to