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

split: move help strings to markdown file

This commit is contained in:
m11o 2023-04-25 22:00:22 +09:00
parent 0984097103
commit 98dd31c00d
2 changed files with 16 additions and 7 deletions

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

@ -0,0 +1,11 @@
# split
```
split [OPTION]... [INPUT [PREFIX]]
```
Create output files containing consecutive or interleaved sections of input
## After Help
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default size is 1000, and default PREFIX is 'x'. With no INPUT, or when INPUT is -, read standard input.

View file

@ -23,7 +23,7 @@ use std::io::{stdin, BufRead, BufReader, BufWriter, ErrorKind, Read, Write};
use std::path::Path; use std::path::Path;
use uucore::display::Quotable; use uucore::display::Quotable;
use uucore::error::{FromIo, UIoError, UResult, USimpleError, UUsageError}; use uucore::error::{FromIo, UIoError, UResult, USimpleError, UUsageError};
use uucore::format_usage; use uucore::{format_usage, help_about, help_usage, help_section};
use uucore::parse_size::{parse_size, ParseSizeError}; use uucore::parse_size::{parse_size, ParseSizeError};
use uucore::uio_error; use uucore::uio_error;
@ -47,11 +47,9 @@ static OPT_ELIDE_EMPTY_FILES: &str = "elide-empty-files";
static ARG_INPUT: &str = "input"; static ARG_INPUT: &str = "input";
static ARG_PREFIX: &str = "prefix"; static ARG_PREFIX: &str = "prefix";
const USAGE: &str = "{} [OPTION]... [INPUT [PREFIX]]"; const ABOUT: &str = help_about!("split.md");
const AFTER_HELP: &str = "\ const USAGE: &str = help_usage!("split.md");
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default \ const AFTER_HELP: &str = help_section!("after help", "split.md");
size is 1000, and default PREFIX is 'x'. With no INPUT, or when INPUT is \
-, read standard input.";
#[uucore::main] #[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> { pub fn uumain(args: impl uucore::Args) -> UResult<()> {
@ -66,7 +64,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
pub fn uu_app() -> Command { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about("Create output files containing consecutive or interleaved sections of input") .about(ABOUT)
.after_help(AFTER_HELP) .after_help(AFTER_HELP)
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.infer_long_args(true) .infer_long_args(true)