From 75984043455569c437c138464ae87369ab0d4f6d Mon Sep 17 00:00:00 2001 From: wuseyu <96163054+wuseyu@users.noreply.github.com> Date: Thu, 9 Mar 2023 17:42:39 +0800 Subject: [PATCH] nl: move help strings to a markdown file (#4477) --- src/uu/nl/nl.md | 7 +++++++ src/uu/nl/src/nl.rs | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 src/uu/nl/nl.md diff --git a/src/uu/nl/nl.md b/src/uu/nl/nl.md new file mode 100644 index 000000000..b64b9f627 --- /dev/null +++ b/src/uu/nl/nl.md @@ -0,0 +1,7 @@ +#nl + +``` +nl [OPTION]... [FILE]... +``` + +Number lines of files diff --git a/src/uu/nl/src/nl.rs b/src/uu/nl/src/nl.rs index 54d0cfea9..eb33eb3b8 100644 --- a/src/uu/nl/src/nl.rs +++ b/src/uu/nl/src/nl.rs @@ -14,12 +14,12 @@ use std::io::{stdin, BufRead, BufReader, Read}; use std::iter::repeat; use std::path::Path; use uucore::error::{FromIo, UResult, USimpleError}; -use uucore::format_usage; +use uucore::{format_usage, help_about, help_usage}; mod helper; -static ABOUT: &str = "Number lines of files"; -static USAGE: &str = "{} [OPTION]... [FILE]..."; +static ABOUT: &str = help_about!("nl.md"); +static USAGE: &str = help_usage!("nl.md"); // Settings store options used by nl to produce its output. pub struct Settings {