Merge pull request #4564 from miles170/head-move-help-strings-to-md-file

head: move help strings to markdown file
This commit is contained in:
Sylvestre Ledru 2023-03-21 09:42:16 +01:00 committed by GitHub
commit 1a0ebdbb8a
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/head/head.md Normal file
View file

@ -0,0 +1,11 @@
# head
```
head [FLAG]... [FILE]...
```
Print the first 10 lines of each `FILE` to standard output.
With more than one `FILE`, precede each with a header giving the file name.
With no `FILE`, or when `FILE` is `-`, read standard input.
Mandatory arguments to long flags are mandatory for short flags too.

View file

@ -11,21 +11,15 @@ use std::io::{self, BufWriter, ErrorKind, Read, Seek, SeekFrom, Write};
use uucore::display::Quotable;
use uucore::error::{FromIo, UError, UResult, USimpleError};
use uucore::lines::lines;
use uucore::{format_usage, show};
use uucore::{format_usage, help_about, help_usage, show};
const BUF_SIZE: usize = 65536;
/// The capacity in bytes for buffered writers.
const BUFWRITER_CAPACITY: usize = 16_384; // 16 kilobytes
const ABOUT: &str = "\
Print the first 10 lines of each FILE to standard output.\n\
With more than one FILE, precede each with a header giving the file name.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
Mandatory arguments to long flags are mandatory for short flags too.\
";
const USAGE: &str = "{} [FLAG]... [FILE]...";
const ABOUT: &str = help_about!("head.md");
const USAGE: &str = help_usage!("head.md");
mod options {
pub const BYTES_NAME: &str = "BYTES";