-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,57 @@ | ||
# GoWatch | ||
|
||
GoWatch is a CLI utility to check a program output and send a signal in case a pattern is recognized. | ||
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](https://github.com/cheina97/gowatch/releases/download/latest) | ||
|
||
### Build from source | ||
|
||
```bash | ||
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: | ||
|
||
```bash | ||
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: | ||
|
||
```json | ||
["regex1", "regex2", "regex3"] | ||
``` | ||
|
||
Then run **gowatch** and pass the program you want to check as argument: | ||
|
||
```bash | ||
gowatch -f patterns.json command arg1 arg2 | ||
``` | ||
|
||
## Options | ||
|
||
These flags can be used to customize the behavior of **gowatch**: | ||
|
||
```bash | ||
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 | ||
``` |