Add --max-filesize option to cli

The --max-filesize option allows filtering files which are larger than
the specified limit. This is potentially useful if one is attempting to
search a number of large files without common file-types/suffixes.

See #369.
This commit is contained in:
tiehuis
2017-02-28 17:53:52 +13:00
committed by Andrew Gallant
parent 49fd668712
commit 714ae82241
7 changed files with 96 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
.\" Automatically generated by Pandoc 1.19.1
.\" Automatically generated by Pandoc 1.19.2.1
.\"
.TH "rg" "1"
.hy
@@ -275,11 +275,21 @@ Follow symlinks.
.RS
.RE
.TP
.B \-m, \-\-max\-count NUM
.B \-m, \-\-max\-count \f[I]NUM\f[]
Limit the number of matching lines per file searched to NUM.
.RS
.RE
.TP
.B \-\-max\-filesize \f[I]NUM\f[]+\f[I]SUFFIX\f[]?
Ignore files larger than \f[I]NUM\f[] in size.
Directories will never be ignored.
.RS
.PP
\f[I]SUFFIX\f[] is optional and may be one of K, M or G.
These correspond to kilobytes, megabytes and gigabytes respectively.
If omitted the input is treated as bytes.
.RE
.TP
.B \-\-maxdepth \f[I]NUM\f[]
Descend at most NUM directories below the command line arguments.
A value of zero searches only the starting\-points themselves.