package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.6.tbz
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0

doc/b0.std/B0_version/index.html

Module B0_versionSource

Software version numbers.

Versions

Sourcetype t = int * int * int * string option

The type for versions. Major, minor, patch and additional info.

Incrementing

Sourceval next_major : ?info:string -> t -> t

next_major ?info (maj, _, _, _) is (maj+1, 0, 0, info).

Sourceval next_minor : ?info:string -> t -> t

next_major ?info (maj, min, _, _) is (maj, min + 1, 0, None).

Sourceval next_patch : ?info:string -> t -> t

next_patch (maj, min, patch, _) is (maj, min, patch + 1, info).

Sourceval with_info : string option -> t -> t

with_info (maj, min, patch, _) info is (maj, min, patch, info).

Converting

Sourceval of_string : string -> t option

of_string parses version strings of the form:

  [v|V]major.minor[.patchlevel][(+|~)additional-info]

into (major, minor, patch, (+|~)additional_info) tuples. If no patchlevel is found 0 is used.

Sourceval to_string : t -> string

to_string v is "major.minor.patchlevel[(+|~)additional-info]"

Sourceval string_drop_initial_v : string -> string

string_drop_initial_v s drops a leading 'v' or 'V' from s.

Formatting

pp formats a version.

Sourceval pp_string : string B0_std.Fmt.t

pp_string formats a version string.