Skip to content

Commit e5db5af

Browse files
authored
docs: updating README with correct v7 usage (#349)
1 parent ae90aac commit e5db5af

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ A tooling and language agnostic utility to calculate the next semantic version b
2929

3030
## Usage
3131
Conventional Commits Next Version can either operate upon a range of Git commits in the repositories' history or on a commit message provided by standard in.
32-
To provide a commit message by standard in simple add the flag `--from-stdin` and standard in will be read.
33-
Otherwise to specify the range of commits you can add either the `--from-commit-hash <commit-hash>` or `--from-reference <reference>` arguments.
32+
To provide a commit message by standard in, use a hyphen (`-`) as the final positional argument.
33+
Otherwise, to specify the range of commits, provide a commit reference (sha, tag, etc.) as the final positional argument.
3434
The range of commits starts exclusively from the commit specified till inclusively of `HEAD`.
3535

3636
Any commits which conform to the Conventional Commits v1.0.0 specification are used to calculate the next Semantic Versioning, based upon the initial semantic version provided via the argument `--from-version <version>`.
3737

38-
The only required arguments is `--from-version <version>` and any of `--from-stdin`, `--from-commit-hash <commit-hash>` or `--from-reference <reference>` arguments.
38+
The only required arguments are `--from-version <version>` and a final positional argument specifying either the commit reference (sha, tag, etc.) to start the calculation from, or a hyphen (`-`) to read from standard in.
3939

4040
The next semantic version can be calculated using a variety of calculation modes.
41-
Currently there are two modes, consecutive and batch mode.
41+
Currently there are two modes: consecutive and batch mode.
4242

4343

4444
### Usage - Consecutive Mode
@@ -52,7 +52,7 @@ E.g.
5252
git clone https://github.com/yargs/yargs.git
5353
cd yargs
5454
git checkout 6014e39bca3a1e8445aa0fb2a435f6181e344c45
55-
RUST_LOG=trace conventional_commits_next_version --from-commit-hash c36c571e4e15dfe26be1d919e4991fb6ab6ed9fd --from-version 15.2.0
55+
RUST_LOG=trace conventional_commits_next_version --from-version 15.2.0 c36c571e4e15dfe26be1d919e4991fb6ab6ed9fd
5656
```
5757

5858
Using the environment variable `RUST_LOG` we can enable more detailed logging, so we can see the logic of consecutive mode.
@@ -96,7 +96,7 @@ E.g.
9696
git clone https://github.com/yargs/yargs.git
9797
cd yargs
9898
git checkout 6014e39bca3a1e8445aa0fb2a435f6181e344c45
99-
RUST_LOG=trace conventional_commits_next_version --calculation-mode "Batch" --from-commit-hash c36c571e4e15dfe26be1d919e4991fb6ab6ed9fd --from-version 15.2.0
99+
RUST_LOG=trace conventional_commits_next_version --calculation-mode "Batch" --from-version 15.2.0 c36c571e4e15dfe26be1d919e4991fb6ab6ed9fd
100100
```
101101

102102
Using the environment variable `RUST_LOG` we can see more detailed logs, to see how batch mode behaves differently.
@@ -133,7 +133,7 @@ conventional-commits-next-version-checking:
133133
- name: Check current vs expected.
134134
run: |
135135
version="v1.0.4" && wget -O - "https://github.com/DeveloperC286/conventional_commits_next_version/releases/download/${version}/x86_64-unknown-linux-gnu.tar.gz" | tar xz --directory "/usr/bin/"
136-
conventional_commits_next_version --calculation-mode "Batch" --from-reference "${{ steps.latest_tag.outputs.tag }}" --from-version "${{ steps.latest_tag.outputs.tag }}" --current-version "${{ steps.current_version.outputs.version }}"
136+
conventional_commits_next_version --calculation-mode "Batch" --current-version "${{ steps.current_version.outputs.version }}" --from-version "${{ steps.latest_tag.outputs.tag }}" "${{ steps.latest_tag.outputs.tag }}"
137137
```
138138
<!-- x-release-please-end -->
139139
@@ -144,14 +144,14 @@ conventional-commits-next-version-checking:
144144
stage: conventional-commits-next-version-checking
145145
image: rust
146146
before_script:
147-
- cargo install conventional_commits_next_version --version ^6
147+
- cargo install conventional_commits_next_version --version ^7
148148
script:
149149
# Get current version.
150150
- current_version=$(grep "^version = \"[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*\"$" "Cargo.toml" | cut -d '"' -f 2)
151151
# Get latest tag.
152152
- latest_tag=$(git describe --tags --abbrev=0)
153153
# Check current vs expected.
154-
- /usr/local/cargo/bin/conventional_commits_next_version --calculation-mode "Batch" --from-reference "${latest_tag}" --from-version "${latest_tag}" --current-version "${current_version}"
154+
- /usr/local/cargo/bin/conventional_commits_next_version --calculation-mode "Batch" --current-version "${current_version}" --from-version "${latest_tag}" "${latest_tag}"
155155
rules:
156156
- if: $CI_MERGE_REQUEST_ID
157157
```

0 commit comments

Comments
 (0)