summaryrefslogtreecommitdiffstats
path: root/src/verb/verb.rs
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2021-08-12 16:46:10 +0200
committerCanop <cano.petrole@gmail.com>2021-08-12 16:46:10 +0200
commitee354f9a7a2684783456b10707462f71045b1c3e (patch)
treeb9618e61403db32d331d98e7c88fd0f0d01181c0 /src/verb/verb.rs
parentc9b840fd85e7eb6393dbb52f4ba3b35cf2f831e7 (diff)
allow a verb in configuration to refer to a builtin
Fix #432
Diffstat (limited to 'src/verb/verb.rs')
-rw-r--r--src/verb/verb.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/verb/verb.rs b/src/verb/verb.rs
index c800b06..336de58 100644
--- a/src/verb/verb.rs
+++ b/src/verb/verb.rs
@@ -169,6 +169,10 @@ impl Verb {
self
}
+ pub fn has_name(&self, searched_name: &str) -> bool {
+ self.names.iter().any(|name| name == searched_name)
+ }
+
/// Assuming the verb has been matched, check whether the arguments
/// are OK according to the regex. Return none when there's no problem
/// and return the error to display if arguments don't match.