From 7376f3ad02b710459fe5d3b206b52236d79fe1de Mon Sep 17 00:00:00 2001 From: Koki Ueha Date: Sun, 19 Mar 2023 03:58:56 +0000 Subject: [PATCH] mktemp: move help strings to markdown file --- src/uu/mktemp/mktemp.md | 7 +++++++ src/uu/mktemp/src/mktemp.rs | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 src/uu/mktemp/mktemp.md diff --git a/src/uu/mktemp/mktemp.md b/src/uu/mktemp/mktemp.md new file mode 100644 index 000000000..75b56d667 --- /dev/null +++ b/src/uu/mktemp/mktemp.md @@ -0,0 +1,7 @@ +# mktemp + +``` +mktemp [OPTION]... [TEMPLATE] +``` + +Create a temporary file or directory. diff --git a/src/uu/mktemp/src/mktemp.rs b/src/uu/mktemp/src/mktemp.rs index 390c77bfa..4a77da4c4 100644 --- a/src/uu/mktemp/src/mktemp.rs +++ b/src/uu/mktemp/src/mktemp.rs @@ -11,7 +11,7 @@ use clap::{crate_version, Arg, ArgAction, ArgMatches, Command}; use uucore::display::{println_verbatim, Quotable}; use uucore::error::{FromIo, UError, UResult, UUsageError}; -use uucore::format_usage; +use uucore::{format_usage, help_about, help_usage}; use std::env; use std::error::Error; @@ -28,8 +28,8 @@ use std::os::unix::prelude::PermissionsExt; use rand::Rng; use tempfile::Builder; -static ABOUT: &str = "Create a temporary file or directory."; -const USAGE: &str = "{} [OPTION]... [TEMPLATE]"; +const ABOUT: &str = help_about!("mktemp.md"); +const USAGE: &str = help_usage!("mktemp.md"); static DEFAULT_TEMPLATE: &str = "tmp.XXXXXXXXXX";