161125.4.2 · 08b7b0aa3e6b72e9c8e9d62777cacf6cf3f8507a
Fix #347 - Keep enough context around to print in stream mode
reading declarations
Changes to tests/pipecontext.t. All files
@@ -0,0 +1,29 @@+Setup:++ $ . $TESTDIR/setup.sh+ $ mkdir pipecontext_dir+ $ printf "a\nb\nc\n" > pipecontext_test.txt+ $ cd pipecontext_dir++Do not use parallel flag, which disables stream input:++ $ unalias ag+ $ alias ag="$TESTDIR/../ag --nocolor --workers=1"++B flag on pipe:++ $ cat ../pipecontext_test.txt | ag --numbers -B1 b+ 1-a+ 2:b++C flag on pipe:++ $ cat ../pipecontext_test.txt | ag --numbers -C1 b+ 1-a+ 2:b+ 3-c++Just match last line:++ $ cat ../pipecontext_test.txt | ag --numbers c+ 3:c