1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-03 22:47:46 +00:00

refactor/nl ~ polish spelling (comments, names, and exceptions)

This commit is contained in:
Roy Ivy III 2021-05-30 20:41:53 -05:00
parent 00c02505a1
commit 5079972ba6
2 changed files with 8 additions and 8 deletions

View file

@ -29,7 +29,7 @@ pub fn parse_options(settings: &mut crate::Settings, opts: &clap::ArgMatches) ->
// This vector holds error messages encountered. // This vector holds error messages encountered.
let mut errs: Vec<String> = vec![]; let mut errs: Vec<String> = vec![];
settings.renumber = !opts.is_present(options::NO_RENUMBER); settings.renumber = !opts.is_present(options::NO_RENUMBER);
match opts.value_of(options::NUMER_SEPARATOR) { match opts.value_of(options::NUMBER_SEPARATOR) {
None => {} None => {}
Some(val) => { Some(val) => {
settings.number_separator = val.to_owned(); settings.number_separator = val.to_owned();
@ -118,7 +118,7 @@ pub fn parse_options(settings: &mut crate::Settings, opts: &clap::ArgMatches) ->
} }
} }
} }
match opts.value_of(options::STARTING_LINE_NUMER) { match opts.value_of(options::STARTING_LINE_NUMBER) {
None => {} None => {}
Some(val) => { Some(val) => {
let conv: Option<u64> = val.parse().ok(); let conv: Option<u64> = val.parse().ok();

View file

@ -79,8 +79,8 @@ pub mod options {
pub const JOIN_BLANK_LINES: &str = "join-blank-lines"; pub const JOIN_BLANK_LINES: &str = "join-blank-lines";
pub const NUMBER_FORMAT: &str = "number-format"; pub const NUMBER_FORMAT: &str = "number-format";
pub const NO_RENUMBER: &str = "no-renumber"; pub const NO_RENUMBER: &str = "no-renumber";
pub const NUMER_SEPARATOR: &str = "number-separator"; pub const NUMBER_SEPARATOR: &str = "number-separator";
pub const STARTING_LINE_NUMER: &str = "starting-line-number"; pub const STARTING_LINE_NUMBER: &str = "starting-line-number";
pub const NUMBER_WIDTH: &str = "number-width"; pub const NUMBER_WIDTH: &str = "number-width";
} }
@ -150,16 +150,16 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
.help("do not reset line numbers at logical pages"), .help("do not reset line numbers at logical pages"),
) )
.arg( .arg(
Arg::with_name(options::NUMER_SEPARATOR) Arg::with_name(options::NUMBER_SEPARATOR)
.short("s") .short("s")
.long(options::NUMER_SEPARATOR) .long(options::NUMBER_SEPARATOR)
.help("add STRING after (possible) line number") .help("add STRING after (possible) line number")
.value_name("STRING"), .value_name("STRING"),
) )
.arg( .arg(
Arg::with_name(options::STARTING_LINE_NUMER) Arg::with_name(options::STARTING_LINE_NUMBER)
.short("v") .short("v")
.long(options::STARTING_LINE_NUMER) .long(options::STARTING_LINE_NUMBER)
.help("first line number on each logical page") .help("first line number on each logical page")
.value_name("NUMBER"), .value_name("NUMBER"),
) )