colorizer

Crates.iocolorizer
lib.rscolorizer
version2.1.0
sourcesrc
created_at2021-06-17 10:24:43.421672
updated_at2023-09-12 19:18:48.019028
descriptionColorizer is a tool for highlighting words in your terminal
homepagehttps://github.com/kulinsky/colorizer
repositoryhttps://github.com/kulinsky/colorizer
max_upload_size
id411294
size19,594
Anton Kulinsky (kulinsky)

documentation

README

Colorizer

Description

Colorizer is a tool for highlighting words in your terminal. It accepts one or more pattern parameters as input and highlights each match in one of the available colors:

  • Black
  • Red
  • Green
  • Yellow
  • Blue
  • Purple
  • Cyan
  • White

Usage

To see the available options, run:

$ colorizer --help

Installation

You can install Colorizer using the following command:

$ cargo install colorizer

Examples

Example 1

Highlight the word "world" in red:

$ echo "hello world" | colorizer --color red --regex world

Example 2

Highlight words containing the letter "r" in green:

$ echo "hello world" | colorizer --regex "\w+r\w+" --color green

Configuration

On startup, Colorizer checks for a configuration file in the home directory ~/.config/colorizer/config.yml. It allows you to use profiles defined in this file.

Create a configuration file in this directory and use a profile from it via the -p or --profile parameter. If the configuration file exists and Colorizer is launched without specifying a profile name, the "default" profile will be used. Colorizer does not terminate abnormally if the configuration file is not found or if the specified profile does not exist.

Usage Example

If the config file exists, you can use the "my_profile" profile as follows:

$ echo "hello, world!" | colorizer -p my_profile

If the config file exists, the "default" profile will be used if no profile is specified:

echo "hello, world!" | colorizer

Configuration Example

Here's an example of a configuration file in YAML format:

profiles:
  default:
    red:
      - "hello .*"
      - "foo"
    blue:
      - "bar .*"
  my_profile:
    red:
      - ".*"

Enjoy using Colorizer and add some color to your terminal experience!

Commit count: 95

cargo fmt