mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-02 05:57:46 +00:00
refactor/split ~ polish spelling (comments, names, and exceptions)
This commit is contained in:
parent
00a2e17c80
commit
451110bba0
1 changed files with 7 additions and 7 deletions
|
@ -157,13 +157,13 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
|
|
||||||
settings.verbose = matches.occurrences_of("verbose") > 0;
|
settings.verbose = matches.occurrences_of("verbose") > 0;
|
||||||
// check that the user is not specifying more than one strategy
|
// check that the user is not specifying more than one strategy
|
||||||
// note: right now, this exact behaviour cannot be handled by ArgGroup since ArgGroup
|
// note: right now, this exact behavior cannot be handled by ArgGroup since ArgGroup
|
||||||
// considers a default value Arg as "defined"
|
// considers a default value Arg as "defined"
|
||||||
let explicit_strategies =
|
let explicit_strategies =
|
||||||
vec![OPT_LINE_BYTES, OPT_LINES, OPT_BYTES]
|
vec![OPT_LINE_BYTES, OPT_LINES, OPT_BYTES]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.fold(0, |count, strat| {
|
.fold(0, |count, strategy| {
|
||||||
if matches.occurrences_of(strat) > 0 {
|
if matches.occurrences_of(strategy) > 0 {
|
||||||
count + 1
|
count + 1
|
||||||
} else {
|
} else {
|
||||||
count
|
count
|
||||||
|
@ -177,10 +177,10 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
settings.strategy = String::from(OPT_LINES);
|
settings.strategy = String::from(OPT_LINES);
|
||||||
settings.strategy_param = matches.value_of(OPT_LINES).unwrap().to_owned();
|
settings.strategy_param = matches.value_of(OPT_LINES).unwrap().to_owned();
|
||||||
// take any (other) defined strategy
|
// take any (other) defined strategy
|
||||||
for strat in vec![OPT_LINE_BYTES, OPT_BYTES].into_iter() {
|
for strategy in vec![OPT_LINE_BYTES, OPT_BYTES].into_iter() {
|
||||||
if matches.occurrences_of(strat) > 0 {
|
if matches.occurrences_of(strategy) > 0 {
|
||||||
settings.strategy = String::from(strat);
|
settings.strategy = String::from(strategy);
|
||||||
settings.strategy_param = matches.value_of(strat).unwrap().to_owned();
|
settings.strategy_param = matches.value_of(strategy).unwrap().to_owned();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue