Merge pull request #35 from smokris/mac-cache

In readme and built-in help, add cache location on macOS and Windows
This commit is contained in:
phiresky 2020-01-13 18:22:13 +01:00 committed by GitHub
commit 235ee0a6bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -174,8 +174,11 @@ The following adapters are disabled by default, and can be enabled using '--rga-
> Disable caching of results > Disable caching of results
> >
> By default, rga caches the extracted text to a database in > By default, rga caches the extracted text, if it is small enough,
> \~/.cache/rga if it is small enough. This way, repeated searches on > to a database in `~/Library/Caches/rga` on macOS,
> `~/.cache/rga` (on other Unixes),
> or `C:\Users\username\AppData\Local\rga` (on Windows).
> This way, repeated searches on
> the same set of files will be much faster. If you pass this flag, all > the same set of files will be much faster. If you pass this flag, all
> caching will be disabled. > caching will be disabled.
@ -234,4 +237,7 @@ export RUST_LOG=debug
export RUST_BACKTRACE=1 export RUST_BACKTRACE=1
``` ```
Also rember to disable caching with `--rga-no-cache` or clear the cache in `~/.cache/rga` to debug the adapters. Also remember to disable caching with `--rga-no-cache` or clear the cache
(`~/Library/Caches/rga` on macOS, `~/.cache/rga` on other Unixes,
or `C:\Users\username\AppData\Local\rga` on Windows)
to debug the adapters.

View File

@ -40,7 +40,10 @@ pub struct RgaArgs {
#[structopt(long = "--rga-no-cache")] #[structopt(long = "--rga-no-cache")]
/// Disable caching of results /// Disable caching of results
/// ///
/// By default, rga caches the extracted text to a database in ~/.cache/rga if it is small enough. /// By default, rga caches the extracted text, if it is small enough,
/// to a database in ~/Library/Caches/rga on macOS,
/// ~/.cache/rga on other Unixes,
/// or C:\Users\username\AppData\Local\rga` on Windows.
/// This way, repeated searches on the same set of files will be much faster. /// This way, repeated searches on the same set of files will be much faster.
/// If you pass this flag, all caching will be disabled. /// If you pass this flag, all caching will be disabled.
pub no_cache: bool, pub no_cache: bool,