Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kojix2/bleach
Tools to remove ANSI color codes and other escape sequences
https://github.com/kojix2/bleach
rust
Last synced: 22 days ago
JSON representation
Tools to remove ANSI color codes and other escape sequences
- Host: GitHub
- URL: https://github.com/kojix2/bleach
- Owner: kojix2
- License: mit
- Created: 2023-12-29T00:27:40.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-18T11:43:43.000Z (8 months ago)
- Last Synced: 2024-04-21T02:15:32.636Z (7 months ago)
- Topics: rust
- Language: Rust
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bleach
[![Cargo Build & Test](https://github.com/kojix2/bleach/actions/workflows/ci.yml/badge.svg)](https://github.com/kojix2/bleach/actions/workflows/ci.yml)
`bleach` is a command-line utility designed to remove ANSI color codes and other escape sequences from files. It provides an easy way to clean up text files that contain unwanted formatting codes, especially useful for logs or output files generated from scripts and programs.
## Installation
```bash
cargo install --git https://github.com/kojix2/bleach
```## Usage
```bash
bleach [options] [file]
```### Options
- `-h, --help`: Display the help menu.
- `-i, --in-place`: Edit the file in-place, saving the result to the same file.
- `-b, --backup`: Create a backup of the original file when using the `-i` option. The backup file is saved with the `.bak` extension.
- `-c, --clean-types [types]`: Specify the types of ANSI sequences to remove: `color`, `movement`, `all`. Defaults to `all` if not specified.### Examples
- Directly edit a file and remove color codes, creating a backup:
```bash
bleach -i -b file.txt
```- Remove specific types of ANSI sequences from a file:
```bash
bleach -i -c color,movement file.txt
```## Contributing
Contributions to `bleach` are welcome! Please feel free to submit pull requests or open issues to suggest improvements or report bugs.
## License
This tool was created making full use of ChatGPT and Copilot.
MIT