aspect-ratio-cli 0.1.3

A simple Rust library to calculate aspect ratio
aspect-ratio-cli-0.1.3 is not a library.

Aspect Ratio

Table of Contents

Crates.io Version Crates.io Total Downloads Crates.io Size (version)

About

Aspect Ratio is a simple CLI tool written in Rust for quickly reducing width and height values to their simplest aspect ratio form. It supports multiple input formats and is designed for fast, efficient use in the terminal.

Getting Started

Follow these instructions to build and use the project on your local machine.

Prerequisites

  • Rust (version 1.86.0 or later)
  • Cargo (comes with Rust)

Building

Clone the repository and build the project:

git clone https://github.com/anhkhoakz/some-rust-scripts/
cd some-rust-scripts
cd aspect-ratio
cargo build --release

Installing

To install the binary system-wide (optional, requires sudo):

just install

You can also install it from crates.io:

cargo install aspect-ratio-cli

Uninstalling

To remove the installed binary:

just uninstall

Or, if installed via Cargo:

cargo uninstall aspect-ratio-cli

Usage

You can run the tool with:

./target/release/aspect-ratio-cli <width> <height>
./target/release/aspect-ratio-cli <width>x<height>
./target/release/aspect-ratio-cli <width>:<height>

Or, if installed system-wide or via Cargo, you can run it directly:

aspect-ratio-cli <width> <height>
aspect-ratio-cli <width>x<height>
aspect-ratio-cli <width>:<height>

Examples

$ aspect-ratio-cli 1920 1080
16:9

$ aspect-ratio-cli 1280x720
16:9

$ aspect-ratio-cli 1024:768
4:3

If you provide invalid input, the tool will print an error and usage instructions.

License

This project is licensed under the GNU General Public License version 2. See the LICENSE file for details.