Skip to content

Commit 5520fe8

Browse files
docs: update readme (#2)
1 parent 865790a commit 5520fe8

File tree

2 files changed

+101
-2
lines changed

2 files changed

+101
-2
lines changed

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Frédéric Maquin <fred@ephread.com>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,86 @@
11
# cargo-semver
22

3+
[![crates.io](https://img.shields.io/crates/v/cargo-semver)](https://codecov.io/gh/filipstefansson/cargo-semver)
34
[![codecov](https://codecov.io/gh/filipstefansson/cargo-semver/branch/master/graph/badge.svg?token=HSAldVxPvX)](https://codecov.io/gh/filipstefansson/cargo-semver)
45

56
**cargo-semver** is a cargo subcommand to help you update the version in your `Cargo.toml` file.
67

7-
- Update the version with `cargo semver major|minor|patch|pre`
8-
- Set a custom version with `cargo semver set 1.0.1`
8+
```console
9+
$ cargo semver
10+
1.0.0
11+
12+
$ cargo semver patch
13+
1.0.1
14+
```
15+
16+
> **Important**: Running this CLI writes to `Cargo.toml`. Make sure to validate the version before commit.
17+
18+
## Installation
19+
20+
```console
21+
$ cargo install cargo-semver
22+
```
23+
24+
## Usage
25+
26+
```console
27+
$ cargo semver # gets the current version
28+
$ cargo semver major|minor|patch|pre # bumps the version
29+
$ cargo set [VERSION] # sets a specific version
30+
```
31+
32+
### Update version
33+
34+
You can update the version in your `Cargo.toml` file using one of the subcommands:
35+
36+
```console
37+
$ cargo semver major
38+
2.0.0
39+
40+
$ cargo semver minor
41+
2.1.0
42+
43+
$ cargo semver patch
44+
2.1.1
45+
46+
$ cargo semver pre alpha
47+
2.1.1-alpha.1
48+
```
49+
50+
If you want to bump the version and add a pre-release version in one command you can use the `pre` flag:
51+
52+
```console
53+
$ cargo semver major --pre alpha
54+
2.0.0-alpha.1
55+
```
56+
57+
### Updating the pre-release version
58+
59+
There are multiple ways of updating the pre-release version:
60+
61+
```console
62+
$ cargo semver major --pre alpha
63+
2.0.0-alpha.1
64+
65+
$ cargo semver pre alpha
66+
2.0.0-alpha.2
67+
68+
$ cargo semver pre
69+
2.0.0-alpha.3
70+
71+
$ cargo semver pre beta
72+
2.0.0-beta.1
73+
```
74+
75+
### Set a specific version
76+
77+
If you want to set an exact version, use the `set` command:
78+
79+
```console
80+
$ cargo semver set 2.1.3-beta.3
81+
2.1.3-beta.3
82+
```
83+
84+
## License
85+
86+
**cargo-semver** is provided under the MIT License. See LICENSE for details.

0 commit comments

Comments
 (0)