Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shorter results with matches found inside long lines #90

Open
indeed-a-genius opened this issue Aug 18, 2017 · 1 comment
Open

Shorter results with matches found inside long lines #90

indeed-a-genius opened this issue Aug 18, 2017 · 1 comment

Comments

@indeed-a-genius
Copy link

I'd like an option to limit the NUM of characters surrounding the match in the results.

For example, currently when I'm searching for "123" inside a file:

qwerty qwertyqwerty qwerty qwertyqwerty qwertyqwertyqwerty 123 qwerty qwerty qwertyqwerty qwerty

the result always displays the whole line from the beginning to the end, making the result long.
qwerty qwertyqwerty qwerty qwertyqwerty qwertyqwertyqwerty 123 qwerty qwerty qwertyqwerty qwerty

With the option, if I set let's say context-chars=10 I'd like to get:
rtyqwerty 123 qwerty qw

The option --output-limit doesn't help because it doesn't take the match's position into the account

@svent
Copy link
Owner

svent commented Aug 20, 2017

Thanks for the suggestion - I had the same problem in the past and will look into it.

I am currently thinking about an option like --output-context that would be similar to --output-limit but work like you suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants