Skip to content

Commit a735df1

Browse files
committed
make matching case-insensitive on zulip
1 parent 0012786 commit a735df1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/zulip/commands.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ pub struct PingGoalsArgs {
176176
/// Helper function to parse CLI arguments without any colored help or error output.
177177
pub fn parse_cli<'a, T: Parser, I: Iterator<Item = &'a str>>(input: I) -> anyhow::Result<T> {
178178
// Add a fake first argument, which is expected by clap
179-
let input = std::iter::once("triagebot").chain(input);
179+
let input = std::iter::once("triagebot")
180+
.chain(input)
181+
.map(|i| i.to_lowercase());
180182

181183
let matches = T::command()
182184
.color(ColorChoice::Never)
@@ -199,6 +201,14 @@ mod tests {
199201
);
200202
}
201203

204+
#[test]
205+
fn uppercase() {
206+
assert_eq!(
207+
parse_chat(&["Work", "show"]),
208+
ChatCommand::Work(WorkqueueCmd::Show)
209+
);
210+
}
211+
202212
#[test]
203213
fn add_command() {
204214
assert_eq!(

0 commit comments

Comments
 (0)