From fcdb7e48ed51ccaf944c087bc1b6b25bd7322e3d Mon Sep 17 00:00:00 2001 From: shaoyuteng Date: Fri, 10 Mar 2023 20:44:28 +0800 Subject: [PATCH] relpath: move help strings to markdown file --- src/uu/relpath/relpath.md | 8 ++++++++ src/uu/relpath/src/relpath.rs | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/uu/relpath/relpath.md diff --git a/src/uu/relpath/relpath.md b/src/uu/relpath/relpath.md new file mode 100644 index 000000000..a1ff9bf4a --- /dev/null +++ b/src/uu/relpath/relpath.md @@ -0,0 +1,8 @@ +# relpath + +``` +relpath [-d DIR] TO [FROM] +``` + +Convert TO destination to the relative path from the FROM dir. +If FROM path is omitted, current working dir will be used. \ No newline at end of file diff --git a/src/uu/relpath/src/relpath.rs b/src/uu/relpath/src/relpath.rs index 522cc54e5..d25956fc1 100644 --- a/src/uu/relpath/src/relpath.rs +++ b/src/uu/relpath/src/relpath.rs @@ -14,10 +14,10 @@ use uucore::display::println_verbatim; use uucore::error::{FromIo, UResult}; use uucore::format_usage; use uucore::fs::{canonicalize, MissingHandling, ResolveMode}; +use uucore::{help_about, help_usage}; -static ABOUT: &str = "Convert TO destination to the relative path from the FROM dir. -If FROM path is omitted, current working dir will be used."; -const USAGE: &str = "{} [-d DIR] TO [FROM]"; +const USAGE: &str = help_usage!("relpath.md"); +const ABOUT: &str = help_about!("relpath.md"); mod options { pub const DIR: &str = "DIR";