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.
let mut errs: Vec<String> = vec![];
settings.renumber = !opts.is_present(options::NO_RENUMBER);
match opts.value_of(options::NUMER_SEPARATOR) {
match opts.value_of(options::NUMBER_SEPARATOR) {
None => {}
Some(val) => {
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 => {}
Some(val) => {
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 NUMBER_FORMAT: &str = "number-format";
pub const NO_RENUMBER: &str = "no-renumber";
pub const NUMER_SEPARATOR: &str = "number-separator";
pub const STARTING_LINE_NUMER: &str = "starting-line-number";
pub const NUMBER_SEPARATOR: &str = "number-separator";
pub const STARTING_LINE_NUMBER: &str = "starting-line-number";
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"),
)
.arg(
Arg::with_name(options::NUMER_SEPARATOR)
Arg::with_name(options::NUMBER_SEPARATOR)
.short("s")
.long(options::NUMER_SEPARATOR)
.long(options::NUMBER_SEPARATOR)
.help("add STRING after (possible) line number")
.value_name("STRING"),
)
.arg(
Arg::with_name(options::STARTING_LINE_NUMER)
Arg::with_name(options::STARTING_LINE_NUMBER)
.short("v")
.long(options::STARTING_LINE_NUMER)
.long(options::STARTING_LINE_NUMBER)
.help("first line number on each logical page")
.value_name("NUMBER"),
)