bitmask-cli 0.1.0

A CLI tool for manipulating individual bits using commands like SET, CLEAR, TOGGLE, CHECK.
# ๐Ÿงฎ Bitmask CLI


A fast and simple **command-line utility** for performing bitwise operations (`SET`, `CLEAR`, `TOGGLE`, `CHECK`) on individual bits of a byte (0โ€“255).
Perfect for learning, debugging, or manipulating binary values.

![GitHub](https://img.shields.io/github/license/theolodocoder/bitmask-cli)
![Crates.io](https://img.shields.io/crates/v/bitmask-cli)
![Rust Version](https://img.shields.io/badge/rust-1.70+-blue.svg)

---

## ๐Ÿš€ Features


- โœ… Set, clear, toggle, and check individual bits
- ๐Ÿ”ข Accepts decimal or binary numbers (`u8`)
- ๐Ÿ“ฆ Easily installable via `cargo install`
- ๐Ÿ“œ Help command and built-in usage guide
- ๐Ÿงช Fully tested with unit tests

---

## ๐Ÿ“ฆ Installation


### From [crates.io]https://crates.io/crates/bitmask-cli


```bash
cargo install bitmask-cli
```

### Or from GitHub


```bash
cargo install --git https://github.com/theolodocoder/bitmask-cli
```

---

## โš™๏ธ Usage


```bash
bitmask-cli --command <COMMAND> --number <NUMBER> --bit-index <INDEX>
```

### Options:


| Flag                | Description                                     |
| ------------------- | ----------------------------------------------- |
| `-c`, `--command`   | Operation: `set`, `clear`, `toggle`, or `check` |
| `-n`, `--number`    | A decimal (0โ€“255) byte value                    |
| `-b`, `--bit-index` | Bit index to manipulate (0โ€“7)                   |

---

## ๐Ÿ“˜ Examples


```bash
bitmask-cli --command set --number 8 --bit-index 3
# Output:

# Original: 00001000 (8)

# Command: Set bit (3)

# Result: 00001000 (8)


bitmask-cli -c toggle -n 8 -b 3
# Result: 00000000 (0)


bitmask-cli -c check -n 8 -b 3
# Bit is set: true

```

---

## ๐Ÿ’ก What Are Bitmasks?


Bitmasking is the technique of using bitwise operations to read or manipulate specific bits in a byte. For example:

- `SET`: Turns a bit to `1`
- `CLEAR`: Turns a bit to `0`
- `TOGGLE`: Flips a bit from `1` to `0` or `0` to `1`
- `CHECK`: Checks whether a bit is `1`

---

## ๐Ÿงช Running Tests


To run tests:

```bash
cargo test
```

---

## ๐Ÿค Contributing


Pull requests, bug reports, and ideas are welcome!
If you're new to open source, this is a great project to get started with Rust.

---

## ๐Ÿ“„ License


This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.

---

## โœจ Author


Made with โค๏ธ by [Your Name](https://github.com/theolodocoder)