Skip to content

GoWatch is a CLI utility to check a program output and send a signal if a pattern is recognized.

License

Notifications You must be signed in to change notification settings

cheina97/gowatch

Repository files navigation

GoWatch

GoWatch is a CLI utility to check a program output (using regex) and send a signal if a pattern is recognized.

Installation

To install GoWatch, you have two options:

Precompiled binaries

Download it from the releases page

Build from source

git clone https://github.com/cheina97/gowatch.git
make build
chmod +x gowatch

Optionally, you can move the binary to a directory in your PATH, for example:

sudo mv gowatch /usr/local/bin/gowatch

Usage

GoWatch allows you to check the output of a program using regex and send a signal when a pattern is recognized.

First of all create a json file containing some regex patterns to check:

["regex1", "regex2", "regex3"]

Then run gowatch and pass the program you want to check as argument:

gowatch -f patterns.json command arg1 arg2

Options

These flags can be used to customize the behavior of gowatch:

Usage of ./gowatch:
  -c int
        Number of concurrent workers (default 4)
  -d    Enable debug mode
  -f string
        Path to the json file which contains the patterns to check
  -q    Disable output
  -s value
        Signal to send to the command's process when its output matches a pattern (default killed)
  -v    Show version

About

GoWatch is a CLI utility to check a program output and send a signal if a pattern is recognized.

Resources

License

Stars

Watchers

Forks

Packages

No packages published