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:
commit
1a0ebdbb8a
2 changed files with 14 additions and 9 deletions
11
src/uu/head/head.md
Normal file
11
src/uu/head/head.md
Normal 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.
|
|
@ -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";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue