[Toybox] grep -A/B/C doesn't respect -n

enh enh at google.com
Tue Feb 2 18:53:18 PST 2016


i had a quick play with the new -A/B/C and noticed that toybox doesn't
respect -n for the context lines. should look something like:

~$ grep -n -C1 CPU /proc/cpuinfo
4-model : 69
5:model name : Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz
6-stepping : 1
...

but actually looks like this:

$ ./toybox grep -n -C1 CPU /proc/cpuinfo
5:model : 69
model name : Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz
stepping : 1

(note also that for the line that _does_ get the -n prefix, there
should be a - rather than a : on non-matching context lines.)

-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.

 1454467998.0


More information about the Toybox mailing list