openSUSE / opi

OBS Package Installer (CLI)
GNU General Public License v3.0
244 stars 22 forks source link

Check if user query is a substring of the possible queries #95

Closed giovcandido closed 2 years ago

giovcandido commented 2 years ago

Hey!

I'm using openSUSE again and I tried to install Brave, but instead of opi brave I used opi brave-browser because of the package name in other distros. I think it would be interesting to check if the user query is a substring of any of the query options.

Have a look at my changes. Thanks!

asdil12 commented 2 years ago

I don't think that this is a good idea as this would prevent users from searching any small substrings that happens to match to a query of a plugin. Eg. when a user would use opi browser there wouldn't be a search done in OBS and PACKMAN repos but the brave plugin would step in.

I have used searche engines that matched on substrings and usually they are a nightmare to use, so I would rather not introduce that here.

Also opi brave-browser should actually work - at least brave-browser is in the the queries of the plugin: https://github.com/openSUSE/opi/blob/master/opi/plugins/brave.py#L8