From e54c0063b01194a7de38b27f4c2a8b1f7ea0dbd6 Mon Sep 17 00:00:00 2001 From: Chen Chi <114895836+ChenChiii@users.noreply.github.com> Date: Wed, 22 Feb 2023 21:01:38 -0800 Subject: [PATCH] shuf: move help strings to markdown file --- src/uu/shuf/shuf.md | 11 +++++++++++ src/uu/shuf/src/shuf.rs | 12 +++--------- 2 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 src/uu/shuf/shuf.md diff --git a/src/uu/shuf/shuf.md b/src/uu/shuf/shuf.md new file mode 100644 index 000000000..41a275035 --- /dev/null +++ b/src/uu/shuf/shuf.md @@ -0,0 +1,11 @@ +# shuf + +``` +shuf [OPTION]... [FILE] +shuf -e [OPTION]... [ARG]... +shuf -i LO-HI [OPTION]...; +``` + +Shuffle the input by outputting a random permutation of input lines. +Each output permutation is equally likely. +With no FILE, or when FILE is -, read standard input. \ No newline at end of file diff --git a/src/uu/shuf/src/shuf.rs b/src/uu/shuf/src/shuf.rs index d0022f5f5..2481baf3d 100644 --- a/src/uu/shuf/src/shuf.rs +++ b/src/uu/shuf/src/shuf.rs @@ -15,7 +15,7 @@ use std::fs::File; use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write}; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError}; -use uucore::format_usage; +use uucore::{format_usage, help_about, help_usage}; mod rand_read_adapter; @@ -25,14 +25,8 @@ enum Mode { InputRange((usize, usize)), } -static USAGE: &str = "\ - {} [OPTION]... [FILE] - {} -e [OPTION]... [ARG]... - {} -i LO-HI [OPTION]..."; -static ABOUT: &str = "\ - Shuffle the input by outputting a random permutation of input lines. \ - Each output permutation is equally likely. \ - With no FILE, or when FILE is -, read standard input."; +static USAGE: &str = help_usage!("shuf.md"); +static ABOUT: &str = help_about!("shuf.md"); struct Options { head_count: usize,