Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split: set names for arg values #3541

Merged
merged 1 commit into from
Jun 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/uu/split/src/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code.

// spell-checker:ignore (ToDO) PREFIXaa nbbbb ncccc
// spell-checker:ignore (ToDO) PREFIXaa PREFIXab nbbbb ncccc

mod filenames;
mod number;
Expand Down Expand Up @@ -47,7 +47,7 @@ static ARG_PREFIX: &str = "prefix";

const USAGE: &str = "{} [OPTION]... [INPUT [PREFIX]]";
const AFTER_HELP: &str = "\
Output fixed-size pieces of INPUT to PREFIXaa, PREFIX ab, ...; default \
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.";

Expand All @@ -74,13 +74,15 @@ pub fn uu_app<'a>() -> Command<'a> {
.short('b')
.long(OPT_BYTES)
.takes_value(true)
.value_name("SIZE")
.help("put SIZE bytes per output file"),
)
.arg(
Arg::new(OPT_LINE_BYTES)
.short('C')
.long(OPT_LINE_BYTES)
.takes_value(true)
.value_name("SIZE")
.default_value("2")
.help("put at most SIZE bytes of lines per output file"),
)
Expand All @@ -89,6 +91,7 @@ pub fn uu_app<'a>() -> Command<'a> {
.short('l')
.long(OPT_LINES)
.takes_value(true)
.value_name("NUMBER")
.default_value("1000")
.help("put NUMBER lines/records per output file"),
)
Expand All @@ -97,15 +100,17 @@ pub fn uu_app<'a>() -> Command<'a> {
.short('n')
.long(OPT_NUMBER)
.takes_value(true)
.value_name("CHUNKS")
.help("generate CHUNKS output files; see explanation below"),
)
// rest of the arguments
.arg(
Arg::new(OPT_ADDITIONAL_SUFFIX)
.long(OPT_ADDITIONAL_SUFFIX)
.takes_value(true)
.value_name("SUFFIX")
.default_value("")
.help("additional suffix to append to output file names"),
.help("additional SUFFIX to append to output file names"),
)
.arg(
Arg::new(OPT_FILTER)
Expand Down Expand Up @@ -137,6 +142,7 @@ pub fn uu_app<'a>() -> Command<'a> {
.short('a')
.long(OPT_SUFFIX_LENGTH)
.takes_value(true)
.value_name("N")
.default_value(OPT_DEFAULT_SUFFIX_LENGTH)
.help("use suffixes of length N (default 2)"),
)
Expand Down