Skip to content

make matching case-insensitive on zulip #2115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jdonszelmann
Copy link

I often use work show from my phone, which automatically capitalizes the first letter in my sentence. I see no reason why we would care about case in these commands, so just converting everything to lowercase shouldn't make a difference to most people while it makes the bot do the right thing more often.

@jdonszelmann
Copy link
Author

jdonszelmann commented Jul 17, 2025

let me know if this makes sense, I thought I wouldn't open an issue since it's such a small change, just making the changes and discussing it here made more sense to me :)

@Urgau
Copy link
Member

Urgau commented Jul 17, 2025

I don't think we currently have any zulip commands that cares about it's argument capitalization, so this would be technically fine.

I still wonder if it wouldn't be better to only lowercase the very first letter of the command.

cc @Kobzol

@jdonszelmann
Copy link
Author

We currently do not, though I just realized that commands that take parameters probably shouldn't get their parameter lowercased. So maybe we should also only do the first word in the arguments, or only do so after the unchanged version failed to parse

@Urgau
Copy link
Member

Urgau commented Jul 17, 2025

So maybe we should also only do the first word in the arguments, or only do so after the unchanged version failed to parse

Both make sense to me. The first one would be simpler to implement.

@Kobzol
Copy link
Member

Kobzol commented Jul 17, 2025

I think that most of our parameters should already be case resistant. But wouldn't using this: https://docs.rs/clap/latest/clap/struct.Arg.html#method.ignore_case be less of a hack?

@Urgau
Copy link
Member

Urgau commented Jul 17, 2025

I didn't knew about that setting, it indeed seems much better.

@Kobzol
Copy link
Member

Kobzol commented Jul 17, 2025

Sadly AFAIK it cannot be currently applied to the whole command, so we need to add it to each argument separately...

@jdonszelmann
Copy link
Author

I looked for that but didn't find it earlier. Would be nice to apply globally ye...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants