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

add '.x' partial version support #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

chtimi59
Copy link

From my own needs...

Maybe an idea form improvement ?

I actually realize that semver_satisfies didn't support those kind of situation (with no "operation"):

  • "1.2.3" should statisfy "1.2.x"
  • "1.2.3" should statisfy "1.2"

To achieved that, I also add a little helper "semver_parse_op" to retrieve "operation" from a string

Example

semver_t semver = {};
char op[3];
semver_parse_op(">=1.2.x", &semver, &op)

/*
returns

 op: ">="

 semver: {
   major = 1
   minor = 2
   patch = 0
   is_major_set = 1
   is_minor_set = 1
   is_patch_set = 0
}
*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant