Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- also allow --degree to take a Callable
- Loading branch information
Showing
10 changed files
with
177 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,39 @@ | ||
Resource usage: | ||
‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒ | ||
|
||
--batch=N | ||
By default, "rak" attempts to use all computer's resources as | ||
much as possible. You can tune some of the parameters related | ||
to parallelism of execution. | ||
|
||
Max number of files to process in a thread (default: 64) | ||
--batch[=N] | ||
|
||
--degree=N | ||
Indicate how many files should be processed within a single worker | ||
thread at a time. Defaults to 64 if not specified. When specified | ||
as a flag without any value, will assume the value 1. | ||
|
||
Max number of threads to use for processing (default: cores - 1) | ||
Examples: | ||
# run a search using batches of 1024 files per worker thread | ||
$ rak --batch=1024 foo | ||
|
||
# run a search with each file handled by a separate worker thread | ||
$ rak --batch foo | ||
|
||
--degree[=N | code] | ||
|
||
Indicate how many worker threads should be use maximally (which | ||
usually effectively means the number of CPU cores to be used). | ||
Defaults to the number of CPU cores minus one (with a minimum of | ||
one, obviously). When specified as a flag without any value, | ||
will assume the value 1. When specified with a Callable, will | ||
call that Callable with the total number of CPUs available, | ||
and will use the result as the value to apply. | ||
|
||
Examples: | ||
# run a search on only one worker thread | ||
$ rak --degree foo | ||
|
||
# run a search on maximally 2 worker threads | ||
$ rak --degree=2 foo | ||
|
||
# run a search on half of the CPUs maximally | ||
$ rak --degree='*/2' foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,77 @@ | ||
Result modifiers: | ||
‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒ | ||
|
||
These options alter the way a search result is processed and shown. | ||
Many combinations of these options may or may not make sense. | ||
|
||
--after-context=N | ||
|
||
List N lines after any line with a match | ||
Also produce N items after any item with a match. Defaults to *no* | ||
items after any item with a match. | ||
|
||
--before-context=N | ||
|
||
List N lines before any line with a match | ||
Also produce N items before any item with a match. Defaults to *no* | ||
items before any item with a match. | ||
|
||
--context=N | ||
|
||
List N lines around any line with a match | ||
Also produce N items before and after any item with a match. | ||
Defaults to *no* items before or after a match. | ||
|
||
--count-only | ||
|
||
Only return count of matches | ||
When specified with a true value, will **ONLY** produce result counts. | ||
|
||
--files-with-matches | ||
|
||
Only return filenames with matches | ||
Produce only the names of files *with* matches. By default, will | ||
return full result information. | ||
|
||
--files-without-matches | ||
|
||
Only return filenames without matches | ||
Produce only the names of files *without* matches. By default, will | ||
return full result information. | ||
|
||
--frequencies | ||
|
||
Only return lines and their frequencies | ||
Create a Bag of the search result and produce the contents of the Bag | ||
in decreasing frequency. Usually used in conjunction with a Callable | ||
pattern that produces a string, or with --matches-only. | ||
|
||
--invert-match | ||
|
||
Select lines that do **not** match | ||
Invert the meaning of matching, producing items that did *not* match. | ||
|
||
--matches-only | ||
|
||
Only produce the actual matches | ||
Only produce the actual matches, instead of the items that matched. | ||
Usually used in conjunction with --unique or --frequencies. | ||
|
||
--max-matches-per-file=N | ||
|
||
Maximum number of matches per file, default: all | ||
Specify the maximum number of matches that should be produced per | ||
file. If not specified, will produce all possible matches of a file. | ||
|
||
--paragraph-context | ||
|
||
List all lines in the same paragraph around a match | ||
Also produce all items before and after any matched item if they are | ||
in the same paragraph. A paragraph being defined as the items between | ||
two items that stringify to the empty string. | ||
|
||
--passthru | ||
|
||
List all lines always | ||
Always produce all items. | ||
|
||
--passthru-context | ||
|
||
List all lines if there is at least one match | ||
Produce all items of a file if there was at least one match. | ||
|
||
--stats-only | ||
|
||
Only return statistics of the search | ||
When specified with a true value, will **ONLY** produce statistics. | ||
See also --stats. | ||
|
||
--unique | ||
|
||
Only return unique lines | ||
Only produce unique items (or whatever a Callable pattern produced). |