From 028b97098dbe759c4613a7649c1ae94b6a718064 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Mon, 27 Feb 2023 10:11:27 +0100 Subject: [PATCH] comm: move help strings to markdown file --- src/uu/comm/comm.md | 13 +++++++++++++ src/uu/comm/src/comm.rs | 8 +++----- 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 src/uu/comm/comm.md diff --git a/src/uu/comm/comm.md b/src/uu/comm/comm.md new file mode 100644 index 000000000..91f4467d4 --- /dev/null +++ b/src/uu/comm/comm.md @@ -0,0 +1,13 @@ +# comm + +``` +comm [OPTION]... FILE1 FILE2 +``` + +Compare two sorted files line by line. + +When FILE1 or FILE2 (not both) is -, read standard input. + +With no options, produce three-column output. Column one contains +lines unique to FILE1, column two contains lines unique to FILE2, +and column three contains lines common to both files. diff --git a/src/uu/comm/src/comm.rs b/src/uu/comm/src/comm.rs index c14717df2..3bc45b6a5 100644 --- a/src/uu/comm/src/comm.rs +++ b/src/uu/comm/src/comm.rs @@ -13,13 +13,12 @@ use std::io::{self, stdin, BufRead, BufReader, Stdin}; use std::path::Path; use uucore::error::FromIo; use uucore::error::UResult; -use uucore::format_usage; +use uucore::{format_usage, help_about, help_usage}; use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; -static ABOUT: &str = "Compare two sorted files line by line"; -static LONG_HELP: &str = ""; -const USAGE: &str = "{} [OPTION]... FILE1 FILE2"; +const ABOUT: &str = help_about!("comm.md"); +const USAGE: &str = help_usage!("comm.md"); mod options { pub const COLUMN_1: &str = "1"; @@ -160,7 +159,6 @@ pub fn uu_app() -> Command { Command::new(uucore::util_name()) .version(crate_version!()) .about(ABOUT) - .after_help(LONG_HELP) .override_usage(format_usage(USAGE)) .infer_long_args(true) .arg(