SemVer is a command-line utility for working with Semantic Versions.
brew install ffurrer2/tap/semver
scoop bucket add ffurrer2 https://github.com/ffurrer2/scoop-bucket
scoop install semver
go install github.com/ffurrer2/semver/v2/cmd/semver@latest
$ semver help
The semantic version utility
Usage:
semver [command]
Available Commands:
compare Compare semantic versions
completion Generate the autocompletion script for the specified shell
filter Filter semantic versions
format Format and print semantic versions
help Help about any command
next Increment semantic versions
sort Sort semantic versions
validate Validate semantic versions
version Print version information
Flags:
-h, --help help for semver
Use "semver [command] --help" for more information about a command.
$ semver compare 1.0.0 1.0.0-alpha.1
1
$ semver filter 1.0.0 1.0 v1.0.0 1.0.0-alpha.1
1.0.0
$ semver format 'v{{.Major}}.{{.Minor}}.{{.Patch}}' 1.0.0-alpha+001
v1.0.0
$ semver next major 1.0.0-alpha+001
1.0.0
$ semver sort 1.1.1 1.0.0 1.0.1
1.0.0
1.0.1
1.1.1
$ semver validate 1.0.0-alpha+001
$ echo $?
0
$ semver version
semver version: 1.8.0
git commit: 10c573e1ec0a6aa302c6ace2d995793139ebc1e6
git tree state: clean
This project is licensed under the MIT License.