1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #4421 from chenchiii/shuf-move-help-strings-to-md-file

shuf: move help strings to markdown file
This commit is contained in:
Sylvestre Ledru 2023-02-23 09:29:32 +01:00 committed by GitHub
commit da7d9ffd6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 9 deletions

11
src/uu/shuf/shuf.md Normal file
View file

@ -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.

View file

@ -15,7 +15,7 @@ use std::fs::File;
use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write}; use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write};
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{FromIo, UResult, USimpleError}; use uucore::error::{FromIo, UResult, USimpleError};
use uucore::format_usage; use uucore::{format_usage, help_about, help_usage};
mod rand_read_adapter; mod rand_read_adapter;
@ -25,14 +25,8 @@ enum Mode {
InputRange((usize, usize)), InputRange((usize, usize)),
} }
static USAGE: &str = "\ static USAGE: &str = help_usage!("shuf.md");
{} [OPTION]... [FILE] static ABOUT: &str = help_about!("shuf.md");
{} -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.";
struct Options { struct Options {
head_count: usize, head_count: usize,