Allow somewhat fuzzy version matching for install and uninstall commands #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR extracts the behaviour added in #115, which allows users to omit prerelease identifiers (like "beta 2") in command arguments when it's unambiguous, and uses it in the install and uninstall commands. If the version is ambiguous then it should fail.
Testing
First, clone this repo if necessary and check out the PR branch:
Right now there's a 12.3 beta available, and with this change you should be able to install it without specifying the beta identifier:
The tests that were added provide examples of how this should work in other situations, and you can try out the install and uninstall commands to verify. If there's an exact match even if there are multiple possible matches (like
12.2
, when12.2
,12.2 beta 1
,12.2 beta 2
,12.2 beta 3
, and12.2 release candidate
are available) then it'll match12.2
. Once the next 12.3 beta is released then12.3
is no longer unambiguous and would fail to match.Closes #116.