From 58dae0a36d6755cd72188d3307a7bfd5fa5bf0c4 Mon Sep 17 00:00:00 2001 From: Koki Ueha Date: Thu, 23 Feb 2023 12:37:01 +0000 Subject: [PATCH] tail: move help strings to markdown file --- src/uu/tail/src/args.rs | 12 +++--------- src/uu/tail/tail.md | 11 +++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 src/uu/tail/tail.md diff --git a/src/uu/tail/src/args.rs b/src/uu/tail/src/args.rs index 0807aa912..6cb77757c 100644 --- a/src/uu/tail/src/args.rs +++ b/src/uu/tail/src/args.rs @@ -17,16 +17,10 @@ use std::ffi::OsString; use std::time::Duration; use uucore::error::{UResult, USimpleError, UUsageError}; use uucore::parse_size::{parse_size, ParseSizeError}; -use uucore::{format_usage, show_warning}; +use uucore::{format_usage, help_about, help_usage, show_warning}; -const ABOUT: &str = "\ - Print the last 10 lines of each FILE to standard output.\n\ - With more than one FILE, precede each with a header giving the file name.\n\ - With no FILE, or when FILE is -, read standard input.\n\ - \n\ - Mandatory arguments to long flags are mandatory for short flags too.\ - "; -const USAGE: &str = "{} [FLAG]... [FILE]..."; +const ABOUT: &str = help_about!("tail.md"); +const USAGE: &str = help_usage!("tail.md"); pub mod options { pub mod verbosity { diff --git a/src/uu/tail/tail.md b/src/uu/tail/tail.md new file mode 100644 index 000000000..fefe7f6ee --- /dev/null +++ b/src/uu/tail/tail.md @@ -0,0 +1,11 @@ +# tail + +``` +tail [FLAG]... [FILE]... +``` + +Print the last 10 lines of each FILE to standard output. +With more than one FILE, precede each with a header giving the file name. +With no FILE, or when FILE is -, read standard input. + +Mandatory arguments to long flags are mandatory for short flags too.