# ๐งฎ 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.



---
## ๐ 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:
| `-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)