Recolor 2.5.0

dotnet tool install --global Recolor --version 2.5.0                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local Recolor --version 2.5.0                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Recolor&version=2.5.0                
nuke :add-package Recolor --version 2.5.0                

Recolor

Colors text received over standard input based on regular expression patterns.

Requirements

  • .NET 6.0 or later

Installation

Recolor is available as a .NET Core tool for installation:

dotnet tool install -g recolor

Usage

recolor COLOR1=REGEX1 COLOR2=REGEX2 ... COLORN=REGEXN

Each line read over standard input is tested against each regular expression pattern (REGEX) in turn. Those that match are used to highlight the matched portion of the text in the corresponding color (COLOR). The regular expression patterns are tested on each line only once unless a start-equal (*=) instead just an equal (=) is used to separate the color from the regular expression pattern specification.

Any command-line argument of the form @FILE is expanded with the contents of the response file identified by FILE. A response file specifies command-line arguments, one per line. Blank lines or lines in the response file starting with pound/hash (#) are ignored. More than one response file can be given. If FILE starts with (~) and is not a path (i.e. contains no directory separators) then either ~/.recolor/FILE.rsp or ~/.recolor/FILE will be sought and used as the response file instead (where ~ is the user home). Processing of all arguments begins after expanding all response files to form a single command-line.

A color is specified in one of three formats:

  1. FOREGROUND
  2. FOREGROUND/BACKGROUND
  3. HEX

Format 1 sets only the foreground color of the text whereas format 2 sets the foreground and background colors (separated by a forward-slash to mean foreground over background). FOREGROUND can be omitted to set just the background. The colors themselves are specified using the names listed below. In format 3, the colors are specified by two hex digits: the first corresponds to the background and the second the foreground. If only a single hex digit is given then it sets the foreground color. The color corresponding to each hex digits is shown below.

Hex Color Name
0 Black
1 DarkBlue
2 DarkGreen
3 DarkCyan
4 DarkRed
5 DarkMagenta
6 DarkYellow
7 Gray
8 DarkGray
9 Blue
A Green
B Cyan
C Red
D Magenta
E Yellow
F White

For REGEX syntax, see Regular Expression Language Quick Reference.

Building

The .NET Core SDK is the minimum requirement.

To build just the binaries on Windows, run:

.\build.cmd

On Linux or macOS, run instead:

./build.sh

To build the binaries and the NuGet packages on Windows, run:

.\pack.cmd

On Linux or macOS, run instead:

./pack.sh
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
2.5.0 772 3/7/2023
2.4.0 1,838 3/7/2019
2.3.0 556 3/6/2019