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

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::display::Quotable;
use uucore::error::{FromIo, UError, UResult, USimpleError}; use uucore::error::{FromIo, UError, UResult, USimpleError};
use uucore::lines::lines; use uucore::lines::lines;
use uucore::{format_usage, show}; use uucore::{format_usage, help_about, help_usage, show};
const BUF_SIZE: usize = 65536; const BUF_SIZE: usize = 65536;
/// The capacity in bytes for buffered writers. /// The capacity in bytes for buffered writers.
const BUFWRITER_CAPACITY: usize = 16_384; // 16 kilobytes const BUFWRITER_CAPACITY: usize = 16_384; // 16 kilobytes
const ABOUT: &str = "\ const ABOUT: &str = help_about!("head.md");
Print the first 10 lines of each FILE to standard output.\n\ const USAGE: &str = help_usage!("head.md");
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]...";
mod options { mod options {
pub const BYTES_NAME: &str = "BYTES"; pub const BYTES_NAME: &str = "BYTES";