Skip to content
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

Make Cmdline modules case insensitive #2223

Merged
merged 1 commit into from
Dec 21, 2017

Conversation

HebaruSan
Copy link
Member

Previously, Cmdline users had to type the exact capitalization of each mod identifier in the install, remove, and upgrade commands. This pull request adds a lookup step to convert "incorrectly"-capitalized identifiers to their correct capitalization, based on what is indexed in the registry. This allows users to type any capitalization they like as long as the letters are all the same.

Before:

$ mono ckan.exe install astroGATOR
Module astroGATOR required but it is not listed in the index, or not available for your version of KSP.
If you're lucky, you can do a `ckan update` and try again.
Try `ckan install --no-recommends` to skip installation of recommended modules.

After:

$ mono ckan.exe install astroGATOR
About to install...

 * Astrogator v0.7.8(cached)

Continue? [Y/n] 

The identifier=version format code is refactored slightly to create a reusable/shared compiled Regex object, then used in CkanModule.FromIDandVersion as well as the new lookup code.

Fixes #889.

@HebaruSan HebaruSan added Cmdline Issues affecting the command line Enhancement New features or functionality Pull request labels Dec 15, 2017
@politas politas merged commit 32e7eab into KSP-CKAN:master Dec 21, 2017
politas added a commit that referenced this pull request Dec 21, 2017
@politas politas removed Enhancement New features or functionality Pull request labels Dec 21, 2017
@HebaruSan HebaruSan deleted the fix/case-insensitive-modules branch December 21, 2017 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cmdline Issues affecting the command line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants