diff --git a/dev/src/uu_nl/helper.rs.html b/dev/src/uu_nl/helper.rs.html index 1228ac899..1df2c2ebe 100644 --- a/dev/src/uu_nl/helper.rs.html +++ b/dev/src/uu_nl/helper.rs.html @@ -99,13 +99,6 @@ 99 100 101 -102 -103 -104 -105 -106 -107 -108
// spell-checker:ignore (ToDO) conv
use crate::options;
@@ -113,17 +106,15 @@
// parse_style parses a style string into a NumberingStyle.
fn parse_style(chars: &[char]) -> Result<crate::NumberingStyle, String> {
if chars.len() == 1 && chars[0] == 'a' {
- Ok(crate::NumberingStyle::NumberForAll)
+ Ok(crate::NumberingStyle::All)
} else if chars.len() == 1 && chars[0] == 't' {
- Ok(crate::NumberingStyle::NumberForNonEmpty)
+ Ok(crate::NumberingStyle::NonEmpty)
} else if chars.len() == 1 && chars[0] == 'n' {
- Ok(crate::NumberingStyle::NumberForNone)
+ Ok(crate::NumberingStyle::None)
} else if chars.len() > 1 && chars[0] == 'p' {
let s: String = chars[1..].iter().cloned().collect();
match regex::Regex::new(&s) {
- Ok(re) => Ok(crate::NumberingStyle::NumberForRegularExpression(Box::new(
- re,
- ))),
+ Ok(re) => Ok(crate::NumberingStyle::Regex(Box::new(re))),
Err(_) => Err(String::from("Illegal regular expression")),
}
} else {
@@ -194,24 +185,19 @@
"Invalid line number field width: ‘0’: Numerical result out of range",
)),
}
+ match opts.get_one::<u64>(options::JOIN_BLANK_LINES) {
+ None => {}
+ Some(num) if *num > 0 => settings.join_blank_lines = *num,
+ Some(_) => errs.push(String::from(
+ "Invalid line number of blank lines: ‘0’: Numerical result out of range",
+ )),
+ }
if let Some(num) = opts.get_one::<i64>(options::LINE_INCREMENT) {
settings.line_increment = *num;
}
if let Some(num) = opts.get_one::<i64>(options::STARTING_LINE_NUMBER) {
settings.starting_line_number = *num;
}
- match opts.get_one::<String>(options::JOIN_BLANK_LINES) {
- None => {}
- Some(val) => {
- let conv: Option<u64> = val.parse().ok();
- match conv {
- None => {
- errs.push(String::from("Illegal value for -l"));
- }
- Some(num) => settings.join_blank_lines = num,
- }
- }
- }
errs
}