mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-22 09:01:04 -05:00
Merge pull request #609 from epage/locale
fix(cli): Don't crash on --locale
This commit is contained in:
commit
6c856a008b
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