mirror of
https://github.com/crate-ci/typos.git
synced 2026-10-18 01:45:12 +02:00
Merge pull request #609 from epage/locale
fix(cli): Don't crash on --locale
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use clap::builder::TypedValueParser;
|
||||
use clap::Parser;
|
||||
|
||||
use typos_cli::config;
|
||||
@@ -129,7 +130,11 @@ pub(crate) struct FileArgs {
|
||||
/// Only allow ASCII characters in identifiers
|
||||
no_unicode: bool,
|
||||
|
||||
#[arg(long, value_parser = clap::builder::PossibleValuesParser::new(config::Locale::variants()))]
|
||||
#[arg(long)]
|
||||
#[arg(
|
||||
value_parser = clap::builder::PossibleValuesParser::new(config::Locale::variants())
|
||||
.map(|l| l.parse::<config::Locale>().unwrap())
|
||||
)]
|
||||
pub(crate) locale: Option<config::Locale>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user