From 4597a5dac0843f57023a5ba99ed2509fbc02c712 Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Thu, 23 Mar 2023 10:10:59 +0100 Subject: [PATCH] touch: move help strings to markdown file --- src/uu/touch/src/touch.rs | 6 +++--- src/uu/touch/touch.md | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 src/uu/touch/touch.md diff --git a/src/uu/touch/src/touch.rs b/src/uu/touch/src/touch.rs index a7d3557bd..31a5f8d73 100644 --- a/src/uu/touch/src/touch.rs +++ b/src/uu/touch/src/touch.rs @@ -19,10 +19,10 @@ use time::macros::{format_description, offset, time}; use time::Duration; use uucore::display::Quotable; use uucore::error::{FromIo, UError, UResult, USimpleError}; -use uucore::{format_usage, show}; +use uucore::{format_usage, help_about, help_usage, show}; -static ABOUT: &str = "Update the access and modification times of each FILE to the current time."; -const USAGE: &str = "{} [OPTION]... [USER]"; +const ABOUT: &str = help_about!("touch.md"); +const USAGE: &str = help_usage!("touch.md"); pub mod options { // Both SOURCES and sources are needed as we need to be able to refer to the ArgGroup. pub static SOURCES: &str = "sources"; diff --git a/src/uu/touch/touch.md b/src/uu/touch/touch.md new file mode 100644 index 000000000..8ce35b686 --- /dev/null +++ b/src/uu/touch/touch.md @@ -0,0 +1,7 @@ +# touch + +``` +touch [OPTION]... [USER] +``` + +Update the access and modification times of each `FILE` to the current time.