From a735df1ff9895522935369cd7381251ea583d375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Thu, 17 Jul 2025 14:22:13 +0200 Subject: [PATCH] make matching case-insensitive on zulip --- src/zulip/commands.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/zulip/commands.rs b/src/zulip/commands.rs index ad66cbe8..c5ca5e37 100644 --- a/src/zulip/commands.rs +++ b/src/zulip/commands.rs @@ -176,7 +176,9 @@ pub struct PingGoalsArgs { /// Helper function to parse CLI arguments without any colored help or error output. pub fn parse_cli<'a, T: Parser, I: Iterator>(input: I) -> anyhow::Result { // Add a fake first argument, which is expected by clap - let input = std::iter::once("triagebot").chain(input); + let input = std::iter::once("triagebot") + .chain(input) + .map(|i| i.to_lowercase()); let matches = T::command() .color(ColorChoice::Never) @@ -199,6 +201,14 @@ mod tests { ); } + #[test] + fn uppercase() { + assert_eq!( + parse_chat(&["Work", "show"]), + ChatCommand::Work(WorkqueueCmd::Show) + ); + } + #[test] fn add_command() { assert_eq!(