pate icon indicating copy to clipboard operation
pate copied to clipboard

Ideas for being reasonable against grep

Open Wikunia opened this issue 7 years ago • 2 comments

I'm using linux and there grep is the way to go I guess. This doesn't mean that pate has no way to be better. There is a huge amount of stuff you can do by using grep in combination with pipes or stuff like that.

Anyway how about:

  • Number of matches per file?
  • Summary of how many matches at all? (oh you do this already... maybe put it in the end instead of the beginning)
  • Is it possible to have a link in the console to click and open the file or even jump to the line?
  • Show the actual line where a match was found (like grep)
  • Show a progress bar if it takes long. (atm you're doing something like this with verbose)

Maybe you have some other ideas how to be better than grep in a niche maybe.

Have fun with your side project and I'll keep it watching.

Wikunia avatar Dec 11 '17 02:12 Wikunia

Thanks for the suggestions.

Number of matches per file?

My purpose is to find out if a file has a pattern, not how many patterns it has. This is simply due to the fact that it allows me to have a little performance boost for files of non-trivial dimension, since I can close the current file and go to the next one if the pattern appears in the first bytes. This is basically the reason why I do this here.

Summary of how many matches at all? (oh you do this already... maybe put it in the end instead of the beginning)

Feel free to open a PR and move it to the bottom :)

Is it possible to have a link in the console to click and open the file or even jump to the line?

I guess this is only possible on certain types of terminals, such as XTerm. I know eslint has this functionality, I have to look deeper on how to implement it

Show the actual line where a match was found (like grep)

I fully agree with this proposal!

Show a progress bar if it takes long. (atm you're doing something like this with verbose)

Do you think it should appear even if I didn't set the verbose flag?

jkomyno avatar Dec 11 '17 09:12 jkomyno

Maybe it can be an option to get all matches and then it's slower.

I think the progress bar is quiet neat if it takes long but that's just a subjective thing.

Wikunia avatar Dec 11 '17 14:12 Wikunia