From a303fdfd413a316c6934b837ab1c5e222722c0e8 Mon Sep 17 00:00:00 2001 From: Max Resnick Date: Sat, 13 Apr 2024 23:54:49 -0700 Subject: feat: add switch to print prior version --- README.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index c633c31..597a4ff 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ bumpver - print the next semantec version in a given sequence ## Usage ```bash -bumpver part [major|minor|patch] [flags] file [-|file] +bumpver part [major|minor|patch] [flags] file [-|file] ``` ## Why? @@ -20,9 +20,7 @@ bumpver part [major|minor|patch] [flags] file [-|file] ## How? -`go-bumpver` takes the sequence of version(s) from a file or stdin and prints the next version. It drops invalid versions in the sequence and only uses valid ones. It does not make a tag or change any state in git or any other VCS it only prints the next version. - -`go-bumpver` has simple but ability to bump pre-release tags using simple formating string. +`go-bumpver` takes the sequence of version(s) from a file or stdin and prints the next version. It drops invalid versions in the sequence and only uses valid ones. It does not make a tag or change any state in git or any other VCS, it only prints the next version. It also has the ability to bump pre-release tags using simple formating string. ### Inputs @@ -51,7 +49,9 @@ bumpver part [major|minor|patch] [flags] file [-|file] 3.3.4 ``` -**bump tags released on a branch** +**bump tags released along a branch** + +This example supports software that has support for multiple versions at once. E.g. version 2.X is still supported but 3.X is based off of main. ```bash ❯ bumpver patch <(git tag --merged ) 2.1.4 @@ -77,6 +77,17 @@ bumpver part [major|minor|patch] [flags] file [-|file] 4.0.0 ``` +***prior version*** +Getting the last version could be useful for generating diffs, release notes etc. + +``` +❯ bumpver major --last-version <(git tag -l) +3.8.1 +❯ bumpver major <(git tag -l) +4.0.0 +``` + + ### Pre-release Pre-releases can be formatted in a way that can be easily bumped. Providing `--prerelease` will generate a new prerelease for the given bump. Meaning if you use `major --prerelease` with the last version 1.2.2 will give `2.0.0-RC.0`. -- cgit v1.2.3