From f4a4bc9edb0cb71044929331bbbc72e5b374d39c Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Sun, 19 Mar 2023 12:56:38 +0100 Subject: [PATCH 1/2] expand: move help strings to markdown file --- src/uu/expand/expand.md | 8 ++++++++ src/uu/expand/src/expand.rs | 7 +++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 src/uu/expand/expand.md diff --git a/src/uu/expand/expand.md b/src/uu/expand/expand.md new file mode 100644 index 000000000..1510a53aa --- /dev/null +++ b/src/uu/expand/expand.md @@ -0,0 +1,8 @@ +# expand + +``` +expand [OPTION]... [FILE]... +``` + +Convert tabs in each FILE to spaces, writing to standard output. +With no FILE, or when FILE is -, read standard input. diff --git a/src/uu/expand/src/expand.rs b/src/uu/expand/src/expand.rs index 7976a0a97..40928aeaf 100644 --- a/src/uu/expand/src/expand.rs +++ b/src/uu/expand/src/expand.rs @@ -19,11 +19,10 @@ use std::str::from_utf8; use unicode_width::UnicodeWidthChar; use uucore::display::Quotable; use uucore::error::{FromIo, UError, UResult}; -use uucore::{crash, format_usage}; +use uucore::{crash, format_usage, help_about, help_usage}; -static ABOUT: &str = "Convert tabs in each FILE to spaces, writing to standard output. - With no FILE, or when FILE is -, read standard input."; -const USAGE: &str = "{} [OPTION]... [FILE]..."; +const ABOUT: &str = help_about!("expand.md"); +const USAGE: &str = help_usage!("expand.md"); pub mod options { pub static TABS: &str = "tabs"; From 1c3ae95e8ad85657ff0cc4f62621fefc05c3372e Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Sun, 19 Mar 2023 14:15:05 +0100 Subject: [PATCH 2/2] expand: docs wrap FILE with backticks --- src/uu/expand/expand.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uu/expand/expand.md b/src/uu/expand/expand.md index 1510a53aa..df7294c30 100644 --- a/src/uu/expand/expand.md +++ b/src/uu/expand/expand.md @@ -4,5 +4,5 @@ expand [OPTION]... [FILE]... ``` -Convert tabs in each FILE to spaces, writing to standard output. -With no FILE, or when FILE is -, read standard input. +Convert tabs in each `FILE` to spaces, writing to standard output. +With no `FILE`, or when `FILE` is `-`, read standard input.