From 5520fe8676c88ca76b459258234e9eb32fb2b8c8 Mon Sep 17 00:00:00 2001 From: Filip Stefansson Date: Mon, 18 Jan 2021 11:05:59 +0100 Subject: [PATCH] docs: update readme (#2) --- LICENSE.txt | 21 ++++++++++++++ README.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..ee39a55 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Frédéric Maquin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index e0460b5..ca07bf8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,86 @@ # cargo-semver +[![crates.io](https://img.shields.io/crates/v/cargo-semver)](https://codecov.io/gh/filipstefansson/cargo-semver) [![codecov](https://codecov.io/gh/filipstefansson/cargo-semver/branch/master/graph/badge.svg?token=HSAldVxPvX)](https://codecov.io/gh/filipstefansson/cargo-semver) **cargo-semver** is a cargo subcommand to help you update the version in your `Cargo.toml` file. -- Update the version with `cargo semver major|minor|patch|pre` -- Set a custom version with `cargo semver set 1.0.1` +```console +$ cargo semver +1.0.0 + +$ cargo semver patch +1.0.1 +``` + +> **Important**: Running this CLI writes to `Cargo.toml`. Make sure to validate the version before commit. + +## Installation + +```console +$ cargo install cargo-semver +``` + +## Usage + +```console +$ cargo semver # gets the current version +$ cargo semver major|minor|patch|pre # bumps the version +$ cargo set [VERSION] # sets a specific version +``` + +### Update version + +You can update the version in your `Cargo.toml` file using one of the subcommands: + +```console +$ cargo semver major +2.0.0 + +$ cargo semver minor +2.1.0 + +$ cargo semver patch +2.1.1 + +$ cargo semver pre alpha +2.1.1-alpha.1 +``` + +If you want to bump the version and add a pre-release version in one command you can use the `pre` flag: + +```console +$ cargo semver major --pre alpha +2.0.0-alpha.1 +``` + +### Updating the pre-release version + +There are multiple ways of updating the pre-release version: + +```console +$ cargo semver major --pre alpha +2.0.0-alpha.1 + +$ cargo semver pre alpha +2.0.0-alpha.2 + +$ cargo semver pre +2.0.0-alpha.3 + +$ cargo semver pre beta +2.0.0-beta.1 +``` + +### Set a specific version + +If you want to set an exact version, use the `set` command: + +```console +$ cargo semver set 2.1.3-beta.3 +2.1.3-beta.3 +``` + +## License + +**cargo-semver** is provided under the MIT License. See LICENSE for details.