2 unstable releases
Uses new Rust 2024
| 0.2.0 | Nov 10, 2025 |
|---|---|
| 0.1.0 | Nov 9, 2025 |
#846 in Command line utilities
44KB
1K
SLoC
neo-lolcat
Rust reimplementation of lolcat maintained by skyline69. It sticks to the standard library while matching the original help surface.
Features
- Streams stdin or multiple files (treating
-as stdin) with the familiar rainbow gradient. - Supports the classic flags (
--spread,--freq,--seed,--animate, etc.) plus a--debugmode for diagnostics. - Detects truecolor terminals automatically while allowing explicit
--truecolor/--forceoverrides. - Handles
Broken pipe/SIGPIPEsituations gracefully so pipelines likemacchina | lolcat -t --animate 1 | head -n1exit cleanly. - Includes unit and integration tests to lock in parser behavior and CLI regressions.
Installing
Install with the following command:
cargo install neo-lolcat
Building
cargo build --release
Optimized binaries are emitted to target/release/lolcat. The release profile enables opt-level=3, fat LTO, single codegen unit, and panic = "abort" for maximum throughput.
Testing
cargo fmt
cargo test
cargo clippy -- -D warnings
The integration suite under tests/cli.rs spawns the compiled binary and checks help/version output plus forced-color pipelines; tests/stress.rs feeds random binary data to guard against crashes. For longer runs, scripts/stress.sh streams configurable amounts of random data through the release binary (requires Python 3).
Continuous Integration
A GitHub Actions workflow (.github/workflows/ci.yml) runs fmt, clippy, unit + integration tests, and a release build on every push/PR to keep the binary stable across toolchains.
Usage
Usage: lolcat [OPTION]... [FILE]...
Concatenate FILE(s), or standard input, to standard output.
With no FILE, or when FILE is -, read standard input.
Refer to lolcat --help for the complete flag list and examples. Use --debug or the legacy LOLCAT_DEBUG=1 environment variable to see internal diagnostics when troubleshooting terminal quirks.