Skip to content
/ bleach Public

Tools to remove ANSI color codes and other escape sequences

License

Notifications You must be signed in to change notification settings

kojix2/bleach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bleach

Cargo Build & Test

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

cargo install --git https://github.com/kojix2/bleach

Usage

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:
bleach -i -b file.txt
  • Remove specific types of ANSI sequences from a file:
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

About

Tools to remove ANSI color codes and other escape sequences

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages