mirror of
https://github.com/uutils/coreutils
synced 2024-11-17 02:08:09 +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;
|
||||
// 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"
|
||||
let explicit_strategies =
|
||||
vec![OPT_LINE_BYTES, OPT_LINES, OPT_BYTES]
|
||||
.into_iter()
|
||||
.fold(0, |count, strat| {
|
||||
if matches.occurrences_of(strat) > 0 {
|
||||
.fold(0, |count, strategy| {
|
||||
if matches.occurrences_of(strategy) > 0 {
|
||||
count + 1
|
||||
} else {
|
||||
count
|
||||
|
@ -177,10 +177,10 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
settings.strategy = String::from(OPT_LINES);
|
||||
settings.strategy_param = matches.value_of(OPT_LINES).unwrap().to_owned();
|
||||
// take any (other) defined strategy
|
||||
for strat in vec![OPT_LINE_BYTES, OPT_BYTES].into_iter() {
|
||||
if matches.occurrences_of(strat) > 0 {
|
||||
settings.strategy = String::from(strat);
|
||||
settings.strategy_param = matches.value_of(strat).unwrap().to_owned();
|
||||
for strategy in vec![OPT_LINE_BYTES, OPT_BYTES].into_iter() {
|
||||
if matches.occurrences_of(strategy) > 0 {
|
||||
settings.strategy = String::from(strategy);
|
||||
settings.strategy_param = matches.value_of(strategy).unwrap().to_owned();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue