Commit 94320ba6 authored by hydrargyrum's avatar hydrargyrum

log-snippet: add README

parent de8d94b8
# log-snippet
log-snippet takes an arbitrary "compilation-log" and shows contextual lines, a bit like `grep -C`
# Synopsis
log-snippet [-C CONTEXTLINES] < LOG
# Example
Take for example the output of `flake8` command:
% flake8 E225 missing whitespace around operator E303 too many blank lines (2) E201 whitespace after '('
... which yields filenames and line numbers, one per line.
For each file/line number, `log-snippet` will show the content of the line number of the file, with optional context lines.
For example, pipe `flake8` output into `log-snippet` and show up to 2 lines before and 2 lines after around the mentioned line:
% flake8 | ~/progextern/attic/log-snippet/ -C 2 foo1(): qux=1 print(qux)
-- c = 3 print(a, b, c)
-- foo2( ): if(1): print('foo')
The default is `-C 5`.
# Compilation log format
The format accepted by log-snippet is used by many compilers and linters, for example flake8, gcc, etc.
`log-snippet` output format is similar to the format returned by `grep -H -n -C 5`.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment