diff --git a/Cargo.toml b/Cargo.toml index 10d710c..7c26c5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,8 +2,8 @@ name = "grits" authors = ["benjamin.van.nguyen@gmail.com"] description = """ -A text line processor that applies regular expressions with named captures -to input lines and transforms them using a user-generated template. +A line-text processor that applies regular expressions with named captures to input lines +and transforms them using a template string. See the long help '--help' for further details and examples. """ version = "0.2.0" edition = "2021" diff --git a/README.md b/README.md index d7de086..87b8d86 100644 --- a/README.md +++ b/README.md @@ -4,210 +4,39 @@ [![Crates.io](https://img.shields.io/crates/v/grits.svg)](https://crates.io/crates/grits) [![Crates.io](https://img.shields.io/crates/d/grits)](https://crates.io/crates/grits) -`grits` is a minimal, simple, and easy-to-use line text-processor that applies regular expressions with named captures to input lines -and transforms them using a custom template string. It allows for efficient parsing, extracting, and formatting of text, -including support for colorization and other attributes you'd get using ANSI escape sequences. +A simple line-text formatter that makes it simple to parse, filter, and format live logs, turning noise into meaningful insights. -The following example demonstrates how to apply `grits` to `tcpdump` to extract a packet's source (`src`) and destination (`dst`) IP address: +![demo gif](images/log.gif) -```bash -sudo tcpdump -nn | grits -p '^(?[^ ]+)' \ - -p 'IP\w? (?[^ ]+)' \ - -p '> (?[^ ]+):' \ - -t '[{(cyan|bold):ts}] {(green|underlined):"src"}={src} {(yellow|underlined):"dst"}={dst}' -``` - -![demo image](images/demo.png) -The top pane in the above screenshot is the raw output of `tcpdump` while the bottom pane shows the output being piped into `grits`. - -## Table of Contents - -* [Usage](#usage) -* [Installation](#installation) -* [Templating language](#templating-language) - - [Indexing](#indexing) - - [Default values](#default-values) - - [Attributes](#attributes) - - [Other examples](#other-examples) -* [Completions](#completions) -* [Contributing](#contributing) -* [Donating](#donating) -* [FAQ](#faq) - -## Usage - -``` -A text line processor that applies regular expressions with named captures to input lines -and transforms them using a user-generated template. See the long help '--help' for further -details and examples. - -Usage: grits [OPTIONS] --template