Ver-CMP
Ver-CMP is a useful cli-tool and library for comparing semantic versions
[!NOTE] The current minimum supported Rust version is: 1.60.0 (Last checked on 3/7/2024)
Cli App
Cli Installation
To build the cli tool, run the following command:
Cli Usage
The cli tool can be used to compare two versions and print out the comparison in many different formats
- Basic Comparison
Output: 0.2.3 (the greater version)
- Comparison with Flags
Output: 0 (indicates ver1 > ver2)
[!TIP] The -c or --compare flag to return a 0 1 or 2 meaning greater, less, or equal respectively; this can be used to easily pipe the output to other commands
Library
This example shows how to use the library to compare two versions and print out the comparison
use *;
You can also take a look in the tests for more examples of how to use the library