From c3817e535957c311188a622203ce412514342731 Mon Sep 17 00:00:00 2001 From: Koki Ueha Date: Thu, 23 Feb 2023 12:17:00 +0000 Subject: [PATCH] tee: move help strings to markdown file --- src/uu/tee/src/tee.rs | 9 +++++---- src/uu/tee/tee.md | 11 +++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/uu/tee/tee.md diff --git a/src/uu/tee/src/tee.rs b/src/uu/tee/src/tee.rs index 71b5edc5c..96c318afd 100644 --- a/src/uu/tee/src/tee.rs +++ b/src/uu/tee/src/tee.rs @@ -11,15 +11,16 @@ use std::io::{copy, sink, stdin, stdout, Error, ErrorKind, Read, Result, Write}; use std::path::PathBuf; use uucore::display::Quotable; use uucore::error::UResult; -use uucore::{format_usage, show_error}; +use uucore::{format_usage, help_about, help_section, help_usage, show_error}; // spell-checker:ignore nopipe #[cfg(unix)] use uucore::libc; -static ABOUT: &str = "Copy standard input to each FILE, and also to standard output."; -const USAGE: &str = "{} [OPTION]... [FILE]..."; +const ABOUT: &str = help_about!("tee.md"); +const USAGE: &str = help_usage!("tee.md"); +const AFTER_HELP: &str = help_section!("after help", "tee.md"); mod options { pub const APPEND: &str = "append"; @@ -88,7 +89,7 @@ pub fn uu_app() -> Command { .version(crate_version!()) .about(ABOUT) .override_usage(format_usage(USAGE)) - .after_help("If a FILE is -, it refers to a file named - .") + .after_help(AFTER_HELP) .infer_long_args(true) .arg( Arg::new(options::APPEND) diff --git a/src/uu/tee/tee.md b/src/uu/tee/tee.md new file mode 100644 index 000000000..8bf097cec --- /dev/null +++ b/src/uu/tee/tee.md @@ -0,0 +1,11 @@ +# tee + +``` +tee [OPTION]... [FILE]... +``` + +Copy standard input to each FILE, and also to standard output. + +## After Help + +If a FILE is -, it refers to a file named - .