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!(