johndharrison/semver

Add support for incomplete version strings

nuest opened this issue · 1 comments

nuest commented
> semver::parse_version("1")
Error in parse_ptr(version) : stoi
> semver::parse_version("1.1")
Error in parse_ptr(version) : stoi

It would be great if the missing elements would be set to a default value, e.g.

semver::parse_version("1", missing = 0)
[1] Maj: 1 Min: 0 Pat: 0

Yes, support for incomplete version strings would be much appreciated.

I have data that sometimes contains three components (mostly two), and I don't want to append a ".0" just to use parse_version, and then take off the ".0".