aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-01-15 15:43:15 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-01-15 15:43:15 +0100
commit28e853e6b085c625af03be5211ded3f307c0fd96 (patch)
tree0fb02956e774e3cc31f7101609e50f1ad06d34e0 /crates
parent2fcab686c414e8d29d16cd51a2158065985758a0 (diff)
downloadmihi-28e853e6b085c625af03be5211ded3f307c0fd96.tar.gz
mihi-28e853e6b085c625af03be5211ded3f307c0fd96.zip
Add a 'categories' parameter to 'select_words_except'
This way the -c/--category flag can also work together with the -i/--inflection one. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'crates')
-rw-r--r--crates/cli/src/run.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/cli/src/run.rs b/crates/cli/src/run.rs
index 31f160e..06d4551 100644
--- a/crates/cli/src/run.rs
+++ b/crates/cli/src/run.rs
@@ -496,7 +496,11 @@ pub fn run(args: Vec<String>) {
if !inflection_only && !run_words(&list, &locale) {
break;
}
- if let Ok(words_to_inflect) = mihi::select_words_except(&list, &flags) {
+ let cats = match category {
+ Some(cat) => vec![cat],
+ None => vec![Category::Noun, Category::Adjective],
+ };
+ if let Ok(words_to_inflect) = mihi::select_words_except(&list, &cats, &flags) {
if !run_inflect_words(&words_to_inflect, &locale) {
break;
}