dalance/amber

How to specify the number of surrounding lines to show as context with ambr?

Opened this issue · 2 comments

How to specify the number of surrounding lines to show as context with ambr?
For making better replacing decisions.

EDIT:
It doesn't seem to have that option, at least according to -h.
I suggest adding this option with -c <N> / --context <N>
It would also be useful for ambs.

Suggestion: If the number is specified with a plus (+) sign in front, only show N following lines, none behind.

Would also be nice to have that in interactive mode in ambr.

e.g.
5 prints 5 lines before and after

for some searches I know I only need to see lines before/after the match so a nice to have feature
+5 prints 5 lines after the match
-5 prints 5 lines before the match

context is indeed useful

probably best to follow established syntax
of tools such as grep, &c.

-A NUM, --after-context=NUM
-B NUM, --before-context=NUM
-C NUM, -NUM, --context=NUM