tea

command module
v0.0.0-...-35cac93 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 15 Imported by: 0

README

tea

GoDoc

This repository contains a tool that triggers actions based on patterns in its input. It is analogous to a combination of tee and grep, with the addition that it can execute an external program in response to matches on the input.

This can be useful for watching log output from a long-running program for certain interesting patterns, e.g.,

bundle exec jekyll serve |
   tea \
    -- 'Regenerating:' say "Rebuilding your site" \
    -- '\bdone in (\d+\.\d)\d* seconds' say 'Build complete after $1 seconds'

Installation

go install github.com/creachadair/tea@latest

Documentation

Overview

Program tea copies its input to its output. Without further instructions, it behaves as cat(1). The command-line may also specify patterns to match in the input, and external programs to invoke when those patterns are found.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL