svent / sift

A fast and powerful alternative to grep
https://sift-tool.org
GNU General Public License v3.0
1.6k stars 108 forks source link

Keep one line warning for suppressed "very long lines" error #49

Closed Niluge-KiWi closed 8 years ago

Niluge-KiWi commented 8 years ago

Followup to #16 which introduced the --err-skip-line-length option to totally disable the "very long lines" error:

--err-skip-line-length is useful to avoid being spammed when many files ave too large lines to be searched.

However, it's dangerous to use this option: it completely silence the fact that some files were skipped because of their size.

To fix this, I suggest to print a one line error, at the end of the sift execution, when at least one file was skipped because of its size (maybe with a skipped file counter).

This would both avoid the spam (one line is not a spam, and if it is, we could have another option to really disable all of this, as it's currently done), and still inform the user that some files have been skipped: if the user wants full results, it could disable the option, or change the blocksize limit, as explained in the current error log.

svent commented 8 years ago

Thanks for your thoughts on this, I think this is a great idea!

I am just not sure whether this should get implemented as

  1. a new option (something like --err-sum-line-length)
  2. the new default, with a new option like --err-show-line-length to show all errors, one line per file

I got the impression over the last months that some users are not happy with the current behavior, so I might favor the second variant as that would still adhere to sift's "search everywhere" design principle and inform the user about possible problems and solutions.

I would be happy to hear some thought on this.

svent commented 8 years ago

I implemented the second variant as of version 0.7.0.