aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 2fe5a26..4f299d4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -79,6 +79,7 @@ struct Args {
#[derive(Debug, Clone)]
enum DropIn {
+ Any,
Basic(String),
Var(String),
OneOf(Vec<DropIn>),
@@ -90,6 +91,10 @@ impl DropIn {
return Err(Error::EmptyOption)
}
+ if text == "?" {
+ return Ok(DropIn::Any);
+ }
+
if text.contains('|') {
let mut option_strs = text.split('|').collect::<Vec<&str>>();
option_strs.dedup();
@@ -166,6 +171,9 @@ impl CategorySet {
DropIn::OneOf(_) => {
panic!("Nested OneOf constructs are not supported")
},
+ DropIn::Any => {
+ self.random_category()?
+ },
};
let words = self.categories.get_mut(&category)