It seems using a context option (-A (after-), -B (before-) or -C (context)) when -v (invert-match) is in use just do nothing as well as disabling the later. I don’t see the utility of this behavior, as well as I didn’t see it documented anywhere in the description of any of these options.
I believe context options used in conjonction with invert-match option should specify which lines *not to show* along with matched then not shown lines. For instance, while this command:
seq 1 100 | grep -v '2$'
does show the list of numbers going from 1 to 100, without those ending with “2” in base 10, this one:
seq 1 100 | grep -v '2$' -A 1
should also hide the lines ending with “3” because they systematically follow those ending with “2” (currently it just show all the numbers from 1 to 100). I didn’t look at if grep does act differently according the order options are given, but if so maybe this behavior could be triggered only if the context option were specified *after* the invert-match one? Thank you for any attention!