Crates.io | pipeview |
lib.rs | pipeview |
version | 0.3.0 |
source | src |
created_at | 2022-08-17 08:17:06.385982 |
updated_at | 2024-09-04 19:37:58.696742 |
description | 🧪 A command line pipe inspection utility. |
homepage | |
repository | https://github.com/mihaigalos/pipeview |
max_upload_size | |
id | 647241 |
size | 211,382 |
A command line pipe inspection utility.
pipeview.toml
file in current folder or ~/.config/
.pv
).We can trigger this functionality by using pipeview
as an intermediate between input and output pipes:
yes | pipeview | xargs echo > /dev/null # transparent pipe
pipeview < Cargo.toml | xargs echo > /dev/null # file pipe
When calling pipeview with no parameters, it will search for commas in the input. If no commas are found, it will default to searching for spaces.
Whichever it finds first will serve as a delimiter for splitting the input for coloring.
Example:
cat ~/.ssh/id_rsa.pub | pipeview
Explicit coloring can be performed on the input based on a regular expression.
cat test/demo_nginx_access_log | pipeview "^(.*?) - - \\[(.*?)\\] \"(.*?) .*?\" (.*?) .*? \".*?\" \"(.*?)\"" 'bgreen white yellow cyan blue'
Nginx and aim logs can be directly inspected using the --nginx
or --aim
flag:
cat test/demo_nginx_access_log | pipeview --nginx
You can create a config in ~/.config/pipeview.toml
or the current folder with filename pipeview.toml
and call it using pipeview --config=foo
.
An example custom config could be:
[foo]
regex="^(.*?) (.*?) (.*?): (.*?) (.*)"
colors="red green blue red green"
In case no custom config is specified, but there is a pipeview.toml
file in the default paths and it contains only one entry, it will be used by default.
This enables you to have the file under version control and just use pipeview
out-of-the-box without any args.
cargo install pipeview