dizzyd / mcdex

Minecraft Modpack Management
Apache License 2.0
75 stars 8 forks source link

mod.list and mod.select are case sensitive #21

Closed LiaungYip closed 5 years ago

LiaungYip commented 6 years ago

The command mod.list is case sensitive. This sometimes leads to guessing games for the correct capitalisation of a mod's name.

For example, consider searching for the mod voxelmap. Do you search for map or Map?

lws@gumption:~/mcdex-test$ ./mcdex mod.list map 1.12
DynmapForge | Dynamically updated web based maps for Minecraft servers | https://minecraft.curseforge.com/projects/dynmapforge
Wynncraft Worldmap Mod | Wynncraft Worldmap Mod | https://minecraft.curseforge.com/projects/wynncraft-worldmap-mod

lws@gumption:~/mcdex-test$ ./mcdex mod.list Map 1.12
JourneyMap | Real-time mapping in-game or your browser as you explore. | https://minecraft.curseforge.com/projects/journeymap
Magical Map | A map to find structures! | https://minecraft.curseforge.com/projects/magical-map
Map Making Tools | Edit NBT data, quickly create structures all in-game! | https://minecraft.curseforge.com/projects/map-making-tools
VoxelMap | Minimap and Worldmap.  Have an overview of your surroundings, or view the entire world.  Create waypoints. | https://minecraft.curseforge.com/projects/voxelmap

lws@gumption:~/mcdex-test$ 

This also hurts a bit when trying to select mods with unknown capitalisation:

lws@gumption:~/mcdex-test$ ./mcdex mod.select test-1.12-pack chisel
-- /home/lws/.minecraft/mcdex/pack/test-1.12-pack --
2017/12/25 22:57:24 No mod found chisel

It would be nice if mcdex could suggest a correction:

No mod found chisel. Did you mean Chisel?

Which would also help for genuine typo errors:

No mod found Chisle. Did you mean Chisel?

I've used github.com/texttheater/golang-levenshtein/levenshtein for this in the past.

I'm happy to submit a PR for this, but haven't been able to get the build process working on Ubuntu 17.10, and so haven't been able to do any development.

dizzyd commented 6 years ago

Hi @LiaungYip! Thanks for the thoughtful feedback. As a preliminary step, I've made the mod.list command use a case-insensitive regex in v0.8.4. Changing mod.select is a little more complicated since it's possible that making it less restrictive could cause mcdex to choose the wrong mod; I need to think a little about how to do that without breaking things.

In the meantime, do you want to file an issue about your build issues on Ubuntu? There's shouldn't be anything too exotic there as the Dockerfile uses an Ubuntu base when building releases.

LiaungYip commented 6 years ago

Hi Dave - thanks for the response. I'm travelling at the moment, but will write up an issue RE: building on Ubuntu, once I get back to my desk in a couple of weeks time.

dizzyd commented 5 years ago

Fixed in 0.9.5