fix(matchers): name matching case-insensitive#335
Conversation
|
Thank you for the pull request! Based on quick testing in a terminal, this seems to fix the resolving part of #102. However, this would now be a breaking change for users that have resources named so that there is difference only in letter case (e.g., upctl router create --name mcduck
upctl router create --name McDuck
upctl router show McDuck
# Succeeds with case-sensitive matching, fails with case-insensitive matching One option would be to use case-sensitive match in this case, but not sure how big change that would require in the resolver that calls the |
|
You are correct that this is breaking change. Especially for users with the same names but different casing. (unlikely but potential bug here) upctl router show --insensitive mcduckSo, without a flag, the show command will function as is, while adding Another option is to maybe add regex to the show command. upctl router show --regex mc[a-z]+Where we can call the regex and return the first match. Let me know your thoughts or if you have some other ideas we can discuss :) |
|
Sorry about the delay with this. I'll try to continue looking into this during next week. |
|
I did some testing on how the current resolver logic could be refactored to support multiple matching levels in #341. That PR adds support for using UUID prefix as argument (similarly than in e.g. |
|
#341 has now been merged, I'll rebase this on top of main early next week and will after that squash and merge this into main. |
|
that was fast :) |
Fixes #102
Added strings.EqualFold to
MatchArgWithWhitespacefunction name.Added tests for
matchers.gofile.