diff --git a/README.md b/README.md index 1da9081..fb4ebde 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ You can customize the colorize rule by regular expression. ![demo](https://github.com/dalance/pipecolor/blob/master/sample/pipecolor.gif) +This demonstration uses `./sample/demo.toml` configuration. + ## Install Download from [release page](https://github.com/dalance/pipecolor/releases/latest), and extract to the directory in PATH. diff --git a/sample/demo.toml b/sample/demo.toml new file mode 100644 index 0000000..84c38d1 --- /dev/null +++ b/sample/demo.toml @@ -0,0 +1,72 @@ +[[lines]] + pat = "(^Error:).*" + colors = ["Red", "LightRed"] + tokens = [] +[[lines]] + pat = "(^Warning:).*" + colors = ["Yellow", "LightYellow"] + tokens = [] +[[lines]] + pat = "(^Information:).*" + colors = ["Green", "LightGreen"] + tokens = [] +[[lines]] + pat = "(^Info:).*" + colors = ["Green", "LightGreen"] + tokens = [] +[[lines]] + pat = "^Verification (SUCCEEDED)" + colors = ["Green", "LightGreen"] + tokens = [] +[[lines]] + pat = "^Verification (FAILED)" + colors = ["Red", "LightRed"] + tokens = [] +[[lines]] + pat = "^(Error-\\[[^]]*\\]).*" + colors = ["Red", "LightRed"] + tokens = [] +[[lines]] + pat = "^(Warning-\\[[^]]*\\]).*" + colors = ["Yellow", "LightYellow"] + tokens = [] +[[lines]] + pat = "^(Lint-\\[[^]]*\\]).*" + colors = ["Green", "LightGreen"] + tokens = [] +[[lines]] + pat = "^(ERROR: \\[[^]]*\\]).*" + colors = ["Red", "LightRed"] + tokens = [] +[[lines]] + pat = "^(CRITICAL WARNING: \\[[^]]*\\]).*" + colors = ["Magenta", "LightMagenta"] + tokens = [] +[[lines]] + pat = "^(WARNING: \\[[^]]*\\]).*" + colors = ["Yellow", "LightYellow"] + tokens = [] +[[lines]] + pat = "^(INFO: \\[[^]]*\\]).*" + colors = ["Green", "LightGreen"] + tokens = [] +[[lines]] + pat = "(^Error :).*" + colors = ["Red", "LightRed"] + tokens = [] +[[lines]] + pat = "(^Warning :).*" + colors = ["Yellow", "LightYellow"] + tokens = [] +[[lines]] + pat = "(^Info :).*" + colors = ["Green", "LightGreen"] + tokens = [] +[[lines]] + pat = "(^\\*\\*ERROR: \\([^)]*\\):).*" + colors = ["Red", "LightRed"] + tokens = [] +[[lines]] + pat = "(^\\*\\*WARN: \\([^)]*\\):).*" + colors = ["Yellow", "LightYellow"] + tokens = []