Explain semver requirements by converting them into less than, greater than, and/or equal to form.

Overview

semver-explain

Convert SemVer requirements to their most-obvious equivalents.

semver-explain is a CLI tool to explain Semantic Versioning requirements by converting them to a form with only less-than, greater-than and/or equal-to comparators, where the major, minor, and patch versions are all specified.

The exact interpretation of SemVer requirements' meaning comes from Cargo. In particular, it does not handle hyphen ranges or x-ranges from the node-semver library for JavaScript.

Why?

It's easy to forget the exact meaning of SemVer comparators like ~, ^, and *. Rather than looking up documentation to confirm what's meant by a requirement, you can plug it into semver-explain and get a set of more-obvious equivalent requirements!

Examples

$ semver-explain "^1.4.0"
>=1.4.0, <2.0.0
$ semver-explain "~0.5.3"
>=0.5.3, <0.6.0
$ semver-explain "5.6.*"
>=5.6.0, <5.7.0

Installation

semver-explain is written in Rust, so you'll need to install Rust first.

# To install from Crates.io
$ cargo install semver-explain
# To install from source (after cloning or downloading)
$ cargo install --path "<path to download>"

How to Use

Just give it a SemVer requirement as a string! The CLI is purposefully simple.

semver-explain 0.2.0

USAGE:
    semver-explain <VERSION_REQ>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <VERSION_REQ>    semantic versioning requirement to explain

License

semver-explain is MIT licensed. The full license text can be found in LICENSE.md.

Thanks

This tool uses the excellent Rust semver library, without which it would have been much more tedious to build.

You might also like...
Configurable, smart and fast CSS/SCSS/Sass/Less formatter.

🌷 Malva Malva is a configurable, smart and fast CSS/SCSS/Sass/Less formatter. Why? Configurable Malva is configurable. It provides several configurat

A series of crates that I made to compile images/video into asciinema & play them.

Bad Apple A series of crates that I made to compile images/video into asciinema & play them. The end goal is to make a kernel & legacy bootloader that

⏳ trackie is a private, daemon-less time tracker for your CLI.
⏳ trackie is a private, daemon-less time tracker for your CLI.

⏳ trackie `trackie` is a private, daemon-less time tracker running in your CLI. Trackie offers an easy CLI to track the time you spent on your various

Scriptable tool to read and write UEFI variables from EFI shell. View, save, edit and restore hidden UEFI (BIOS) Setup settings faster than with the OEM menu forms.
Scriptable tool to read and write UEFI variables from EFI shell. View, save, edit and restore hidden UEFI (BIOS) Setup settings faster than with the OEM menu forms.

UEFI Variable Tool (UVT) UEFI Variable Tool (UVT) is a command-line application that runs from the UEFI shell. It can be launched in seconds from any

A `nix` and `nix-shell` wrapper for shells other than `bash`

nix-your-shell A nix and nix-shell wrapper for shells other than bash. nix develop and nix-shell use bash as the default shell, so nix-your-shell prin

A localized open-source AI server that is better than ChatGPT.
A localized open-source AI server that is better than ChatGPT.

💯AI00 RWKV Server English | 中文 | 日本語 AI00 RWKV Server is an inference API server based on the RWKV model. It supports VULKAN inference acceleration a

More than safe rust abstractions over rytm-sys, an unofficial SDK for writing software for Analog Rytm running on firmware 1.70.
More than safe rust abstractions over rytm-sys, an unofficial SDK for writing software for Analog Rytm running on firmware 1.70.

rytm-rs More than safe rust abstractions over rytm-sys, an unofficial SDK for writing software for Analog Rytm running on firmware 1.70. On top of CC

Captures packets and streams them to other devices. Built for home network analysis and A&D CTFs.

🍩 shiny-donut shiny-donut is a packet capture app that supports streaming packets from a remote system to another device. The main use for this is to

Uses the cardano mini-protocols to receive every block and transaction, and save them to a configurable destination

cardano-slurp Connects to one or more cardano-node's, streams all available transactions, and saves them to disk (or to S3) in raw cbor format. Usage

Comments
  • edition2021 features really necessary?

    edition2021 features really necessary?

    Hi, I tried to install semver-explain according to the instructions in the readme. But it complains, that I should use a cargo nightly version. Since I'm not a rust developer I'm refraining from doing so. Are these edition2021 feature really necessary?

    # cargo install semver-explain
        Updating crates.io index
      Downloaded semver-explain v0.2.1
    error: failed to parse manifest at `/Users/jkohl/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-explain-0.2.1/Cargo.toml`
    
    Caused by:
      feature `edition2021` is required
    
      this Cargo does not support nightly features, but if you
      switch to nightly channel you can add
      `cargo-features = ["edition2021"]` to enable this feature
    
    # cargo --version
    cargo 1.52.0 (69767412a 2021-04-21)
    
    # uname -a
    Darwin Bargain.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101 arm64
    
    opened by jk 4
  • Inconsistent ranges for ^major.minor requirements

    Inconsistent ranges for ^major.minor requirements

    From the Cargo book, any caret requirement starting with 1. should be compatible up to <2.0.0:

    ^1.2.3  :=  >=1.2.3, <2.0.0
    ^1.2    :=  >=1.2.0, <2.0.0
    ^1      :=  >=1.0.0, <2.0.0
    

    But this is what I found:

    $ semver-explain "^1.2.3"
    >=1.2.3, <2.0.0
    $ semver-explain "^1.2"
    >=1.2.0, <1.3.0
    $ semver-explain "^1"
    >=1.0.0, <2.0.0
    

    Only major.minor strings appear to have this problem.

    $ semver-explain --version
    semver-explain 0.2.1
    
    opened by trentj 1
  • Add Github Action to build binaries

    Add Github Action to build binaries

    Based on our discussion here [1] I'm following up with a proposed Github Actions workflow to create binaries when a release is created. I did some basic tests locally, but I'm sure I've got something wrong somewhere :)

    Note that you will need to add a token to the secrets in this repository named GITHUB_TOKEN.

    1 - https://lobste.rs/s/yn9n7q/semver_explain_convert_semver

    opened by stchris 1
Releases(v0.2.2)
Owner
Andrew Lilley Brinker
Software supply chain security and Rust.
Andrew Lilley Brinker
Stay on top of semver using your changelog.

semverlog - semantic versioning meets changelogs The semantic versioning specification (https://semver.org) gives us a tool sanely evolve software. Ho

Thomas Eizinger 10 Mar 25, 2023
Turbine is a toy CLI app for converting Rails schema declarations into equivalent type declarations in other languages.

Turbine Turbine is a toy CLI app for converting Rails schema declarations into equivalent type declarations in other languages. It’s described as a to

Justin 2 Jan 21, 2022
coins20's graduation requirements checker

tanici 筑波大学の履修管理システム twins が出力するCSV(UTF-8)をもとに,coins20(情報科学類2020年度生)が卒業可能であるかを判定し不足を出力します.おまけとしてGPAの算出も行います. (免責事項:精度の保証はしません.あくまで参考程度に,責任は負いません.) Usa

cyanolupus 1 Jan 31, 2022
Minimal recursive "truncate file/directory names to meet requirements" tool

trunc_filenames ssokolow@monolith ~ % trunc_filenames --help trunc_filenames 0.1.0 Rename files and directories to fit length limits. WARNING: Will n

Stephan Sokolow 2 Nov 20, 2022
Add CLI & form interface to your program

Add CLI & form interface to your program

null 292 Nov 4, 2022
This project returns Queried value from SOAP(XML) in form of JSON.

About This is project by team SSDD for HachNUThon (TechHolding). This project stores and allows updating SOAP(xml) data and responds to various querie

Sandipsinh Rathod 3 Apr 30, 2023
🦀️atos for linux by rust - A partial replacement for Apple's atos tool for converting addresses within a binary file to symbols.

atosl-rs ??️ atos for linux by rust - A partial replacement for Apple's atos tool for converting addresses within a binary file to symbols. tested on

everettjf 60 Dec 29, 2022
A blazingly fast command-line tool for converting Chinese punctuations to English punctuations

A blazingly fast command-line tool for converting Chinese punctuations to English punctuations

Hogan Lee 9 Dec 23, 2022
A simple CLI tool for converting CSV file content to JSON.

fast-csv-to-json A simple CLI tool for converting CSV file content to JSON. 我花了一個小時搓出來,接著優化了兩天的快速 CSV 轉 JSON CLI 小工具 Installation Install Rust with ru

Ming Chang 3 Apr 5, 2023
Just a UNIX's cat copy, but less bloated and in Rust.

RAT The opposite of UNIX's cat, less bloated, and in Rust. About the project The idea of this CLI is "A CLI program that is basically UNIX's cat comma

Renan Fernandes 2 Mar 5, 2022