aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--README.md72
1 files changed, 72 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ead9645
--- /dev/null
+++ b/README.md
@@ -0,0 +1,72 @@
+# go-bumpver
+
+_Inspired by the python bump2version tool._
+
+bumpver - next semantec version in a given sequence
+
+## Usage
+
+```
+bumpver part [major|minor|patch] file [-|file] [flags]
+```
+
+## Why?
+
+- Most version bumpers are fairly tightly coupled to git.
+- Most like to make commits for you
+- Few seem to have useful pre release mechanisms
+- None seem to provide simple interfaces
+- Lack of unix philosophy
+
+Many tools touch git and some opinionatedly like to touch it.
+
+## How?
+
+`go-bumpver` takes the sequence of version(s) from a file or stdin and prints the next version. It ignores invalid versions in the sequence and only uses valid ones.
+
+### Inputs
+
+*stdin*
+```
+❯ echo "1.1.1\n1.2.1" | bumpver patch -
+1.2.2%
+```
+
+*file*
+```
+❯ echo v0.1.0 > VERSION
+❯ bumpver patch VERSION
+0.1.1%
+```
+
+*local repo*
+```
+❯ bumpver patch <(git tag -l)
+3.3.2%
+```
+
+*remote repo*
+```
+❯ bumpver patch <(git ls-remote --tags --refs origin v\* | awk -F'[ /]' '{ print $NF }')
+3.3.4%
+```
+
+### Bumps
+
+*a patch*
+```
+❯ bumpver patch <(git tag -l)
+3.3.2%
+```
+
+*a minor*
+```
+❯ bumpver minor <(git tag -l)
+3.4.0%
+```
+
+*a major*
+```
+❯ bumpver major <(git tag -l)
+4.0.0%
+```