semver

module
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2022 License: MIT

README

SemVer

CI MIT License Go Version Go Report Card GitHub Release

SemVer is a command-line utility for working with Semantic Versions.

Install

Homebrew
brew install ffurrer2/tap/semver
Scoop
scoop bucket add ffurrer2 https://github.com/ffurrer2/scoop-bucket
scoop install semver
Build from source
go install github.com/ffurrer2/semver/cmd/semver@latest

Usage

help
$ semver help
The semantic version utility

Usage:
  semver [command]

Available Commands:
  compare     Compare semantic versions
  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.
compare
$ semver compare 1.0.0 1.0.0-alpha.1
1
filter
$ semver filter 1.0.0 1.0 v1.0.0 1.0.0-alpha.1
1.0.0
1.0.0-alpha.1
format
$ semver format 'v{{.Major}}.{{.Minor}}.{{.Patch}}' 1.0.0-alpha+001
v1.0.0
next major/minor/patch
$ semver next major 1.0.0-alpha+001
1.0.0
sort
$ semver sort 1.1.1 1.0.0 1.0.1
1.0.0
1.0.1
1.1.1
validate
$ semver validate 1.0.0-alpha+001
$ echo $?
0
version
$ semver version
semver version 1.0.0
commit: 224394b9d709277fe5e4965a6633535c597cd2ed
built at: 2020-06-18T20:22:25Z

License

This project is licensed under the MIT License.

Directories

Path Synopsis
cmd
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL