mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-25 10:31:02 -05:00
fix(cli): Don't crash on --locale
This commit is contained in:
parent
e87d192bc5
commit
f71f83b439
1 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
use clap::builder::TypedValueParser;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
use typos_cli::config;
|
use typos_cli::config;
|
||||||
|
@ -129,7 +130,11 @@ pub(crate) struct FileArgs {
|
||||||
/// Only allow ASCII characters in identifiers
|
/// Only allow ASCII characters in identifiers
|
||||||
no_unicode: bool,
|
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>,
|
pub(crate) locale: Option<config::Locale>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue