From 1c9b49025b90120d666382138e38d6e4adbbd4fe Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski Date: Mon, 3 Apr 2023 16:54:37 +0200 Subject: [PATCH] true: move help strings to markdown file --- src/uu/true/src/true.rs | 9 ++------- src/uu/true/true.md | 11 +++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 src/uu/true/true.md diff --git a/src/uu/true/src/true.rs b/src/uu/true/src/true.rs index 7c373fb7a..334652ce8 100644 --- a/src/uu/true/src/true.rs +++ b/src/uu/true/src/true.rs @@ -7,14 +7,9 @@ use clap::{Arg, ArgAction, Command}; use std::{ffi::OsString, io::Write}; use uucore::error::{set_exit_code, UResult}; +use uucore::help_about; -static ABOUT: &str = "\ -Returns true, a successful exit status. - -Immediately returns with the exit status `0`, except when invoked with one of the recognized -options. In those cases it will try to write the help or version text. Any IO error during this -operation causes the program to return `1` instead. -"; +const ABOUT: &str = help_about!("true.md"); #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { diff --git a/src/uu/true/true.md b/src/uu/true/true.md new file mode 100644 index 000000000..b21c9616e --- /dev/null +++ b/src/uu/true/true.md @@ -0,0 +1,11 @@ +# true + +``` +true +``` + +Returns true, a successful exit status. + +Immediately returns with the exit status `0`, except when invoked with one of the recognized +options. In those cases it will try to write the help or version text. Any IO error during this +operation causes the program to return `1` instead.