diff --git a/README.md b/README.md index 7426c6e..b5c0dec 100644 --- a/README.md +++ b/README.md @@ -87,13 +87,14 @@ if (v2 == v4) then ! true ## Increment versions -`Prerelease` and `build` data are cleared each time a major, minor or patch number is incremented. A `prerelease` is incremented by adding `1` to the last identifier if the latter is numeric. If the last identifier isn't a number or no `prerelease` labels exists, a new identifier is added with the value of `1`. Existing `build` information is cleared each time a `prerelease` is incremented. +`Prerelease` and `build` data are cleared each time a major, minor or patch number is incremented. `prerelease` and `build` values are incremented by adding `1` to the their last identifier if it is numeric. If the last identifier isn't a number or no identifiers exist, a new identifier is added with the value of `1`. Existing `build` information is cleared each time a `prerelease` is incremented. ```fortran type(version_t) :: version version = version_t(0, 5, 3, 'beta.1', '1') +call version%increment_build() ! 0.5.3-beta.1+2 call version%increment_prerelease() ! 0.5.3-beta.2 call version%increment_patch() ! 0.5.4 call version%increment_minor() ! 0.6.0 @@ -135,7 +136,7 @@ call v1%increment_prerelease() ! 0.5.4-2 ## build metadata -`build` metadata can be included and will be appended after the `patch` or the `prerelease` via a `+` sign. The identifiers must comprise only ASCII alphanumerics and hyphens `[0-9A-Za-z-]` and are separated by dots. Numerical identifiers must not start with a `0` digit. The `build` data is not used for comparison and it is cleared each time the version is incremented. +`build` metadata can be included and will be appended after the `patch` or the `prerelease` via a `+` sign. The identifiers must comprise only ASCII alphanumerics and hyphens `[0-9A-Za-z-]` and are separated by dots. Numerical identifiers must not start with a `0` digit. `build` data is not used for comparison and it is cleared each time a `major`, `minor`, `patch` or `prerelease` version is incremented. A `build` value can be [incremented](#increment-versions). ```fortran type(version_t) :: v1, v2 @@ -149,9 +150,11 @@ print *, v2%to_string() ! '0.5.3+abc.1-13' print *, v1 == v2 ! true call v1%increment_patch() ! 0.5.4 +call v1%increment_build() ! 0.5.4+1 v1 = version_t(0, 5, 3, 'alpha.1' '1') print *, v1%to_string() ! '0.5.3-alpha.1+1' +print *, v1%increment_build() ! '0.5.3-alpha.1+2' ``` ## More examples