Skip to content

Commit a80ceb9

Browse files
authored
Merge pull request #11 from cyqsimon/plural
Unify plural argument naming & add aliases
2 parents f199985 + c4a2b75 commit a80ceb9

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

countryfetch/src/args.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,23 @@ pub struct Args {
7474
/// Exclude population
7575
#[arg(long, help_heading = "Config")]
7676
pub no_population: bool,
77-
/// Exclude top-level domain
78-
#[arg(long, help_heading = "Config")]
79-
pub no_tld: bool,
77+
/// Exclude top-level domains
78+
#[arg(long, help_heading = "Config", alias = "no-tld")]
79+
pub no_tlds: bool,
8080
/// Exclude languages
81-
#[arg(long, help_heading = "Config")]
81+
#[arg(long, help_heading = "Config", alias = "no-language")]
8282
pub no_languages: bool,
83-
/// Exclude currency
84-
#[arg(long, help_heading = "Config")]
85-
pub no_currency: bool,
83+
/// Exclude currencies
84+
#[arg(long, help_heading = "Config", alias = "no-currency")]
85+
pub no_currencies: bool,
8686
/// Exclude neighbours
87-
#[arg(long, help_heading = "Config")]
87+
#[arg(long, help_heading = "Config", aliases = ["no-neighbour", "no-neighbors", "no-neighbor"])]
8888
pub no_neighbours: bool,
8989
/// Exclude established date
9090
#[arg(long, help_heading = "Config")]
9191
pub no_established_date: bool,
9292
/// Exclude iso codes
93-
#[arg(long, help_heading = "Config")]
93+
#[arg(long, help_heading = "Config", alias = "no-iso-code")]
9494
pub no_iso_codes: bool,
9595
/// Exclude driving side
9696
#[arg(long, help_heading = "Config")]

countryfetch/src/country_format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ pub fn format_country(
336336
.filter(|_| (!args.no_continent)),
337337
population: (!args.no_population)
338338
.then_some(country.map_or(gen_country.population(), |c| c.population)),
339-
top_level_domain: (!args.no_tld).then_some(&country.map_or_else(
339+
top_level_domain: (!args.no_tlds).then_some(&country.map_or_else(
340340
|| {
341341
gen_country
342342
.top_level_domain()
@@ -356,7 +356,7 @@ pub fn format_country(
356356
},
357357
|c| c.languages.clone().into_values().collect(),
358358
)),
359-
currency: (!args.no_currency).then_some((
359+
currency: (!args.no_currencies).then_some((
360360
gen_country::currency_position(gen_country),
361361
country.map_or_else(
362362
|| {

0 commit comments

Comments
 (0)