tsunami-code 2.5.1 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,524 @@
1
+ ripgrep (rg)
2
+ ------------
3
+ ripgrep is a line-oriented search tool that recursively searches the current
4
+ directory for a regex pattern. By default, ripgrep will respect gitignore rules
5
+ and automatically skip hidden files/directories and binary files. (To disable
6
+ all automatic filtering by default, use `rg -uuu`.) ripgrep has first class
7
+ support on Windows, macOS and Linux, with binary downloads available for [every
8
+ release](https://github.com/BurntSushi/ripgrep/releases). ripgrep is similar to
9
+ other popular search tools like The Silver Searcher, ack and grep.
10
+
11
+ [![Build status](https://github.com/BurntSushi/ripgrep/workflows/ci/badge.svg)](https://github.com/BurntSushi/ripgrep/actions)
12
+ [![Crates.io](https://img.shields.io/crates/v/ripgrep.svg)](https://crates.io/crates/ripgrep)
13
+ [![Packaging status](https://repology.org/badge/tiny-repos/ripgrep.svg)](https://repology.org/project/ripgrep/badges)
14
+
15
+ Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org).
16
+
17
+
18
+ ### CHANGELOG
19
+
20
+ Please see the [CHANGELOG](CHANGELOG.md) for a release history.
21
+
22
+ ### Documentation quick links
23
+
24
+ * [Installation](#installation)
25
+ * [User Guide](GUIDE.md)
26
+ * [Frequently Asked Questions](FAQ.md)
27
+ * [Regex syntax](https://docs.rs/regex/1/regex/#syntax)
28
+ * [Configuration files](GUIDE.md#configuration-file)
29
+ * [Shell completions](FAQ.md#complete)
30
+ * [Building](#building)
31
+ * [Translations](#translations)
32
+
33
+
34
+ ### Screenshot of search results
35
+
36
+ [![A screenshot of a sample search with ripgrep](https://burntsushi.net/stuff/ripgrep1.png)](https://burntsushi.net/stuff/ripgrep1.png)
37
+
38
+
39
+ ### Quick examples comparing tools
40
+
41
+ This example searches the entire
42
+ [Linux kernel source tree](https://github.com/BurntSushi/linux)
43
+ (after running `make defconfig && make -j8`) for `[A-Z]+_SUSPEND`, where
44
+ all matches must be words. Timings were collected on a system with an Intel
45
+ i9-12900K 5.2 GHz.
46
+
47
+ Please remember that a single benchmark is never enough! See my
48
+ [blog post on ripgrep](https://blog.burntsushi.net/ripgrep/)
49
+ for a very detailed comparison with more benchmarks and analysis.
50
+
51
+ | Tool | Command | Line count | Time |
52
+ | ---- | ------- | ---------- | ---- |
53
+ | ripgrep (Unicode) | `rg -n -w '[A-Z]+_SUSPEND'` | 536 | **0.082s** (1.00x) |
54
+ | [hypergrep](https://github.com/p-ranav/hypergrep) | `hgrep -n -w '[A-Z]+_SUSPEND'` | 536 | 0.167s (2.04x) |
55
+ | [git grep](https://www.kernel.org/pub/software/scm/git/docs/git-grep.html) | `git grep -P -n -w '[A-Z]+_SUSPEND'` | 536 | 0.273s (3.34x) |
56
+ | [The Silver Searcher](https://github.com/ggreer/the_silver_searcher) | `ag -w '[A-Z]+_SUSPEND'` | 534 | 0.443s (5.43x) |
57
+ | [ugrep](https://github.com/Genivia/ugrep) | `ugrep -r --ignore-files --no-hidden -I -w '[A-Z]+_SUSPEND'` | 536 | 0.639s (7.82x) |
58
+ | [git grep](https://www.kernel.org/pub/software/scm/git/docs/git-grep.html) | `LC_ALL=C git grep -E -n -w '[A-Z]+_SUSPEND'` | 536 | 0.727s (8.91x) |
59
+ | [git grep (Unicode)](https://www.kernel.org/pub/software/scm/git/docs/git-grep.html) | `LC_ALL=en_US.UTF-8 git grep -E -n -w '[A-Z]+_SUSPEND'` | 536 | 2.670s (32.70x) |
60
+ | [ack](https://github.com/beyondgrep/ack3) | `ack -w '[A-Z]+_SUSPEND'` | 2677 | 2.935s (35.94x) |
61
+
62
+ Here's another benchmark on the same corpus as above that disregards gitignore
63
+ files and searches with a whitelist instead. The corpus is the same as in the
64
+ previous benchmark, and the flags passed to each command ensure that they are
65
+ doing equivalent work:
66
+
67
+ | Tool | Command | Line count | Time |
68
+ | ---- | ------- | ---------- | ---- |
69
+ | ripgrep | `rg -uuu -tc -n -w '[A-Z]+_SUSPEND'` | 447 | **0.063s** (1.00x) |
70
+ | [ugrep](https://github.com/Genivia/ugrep) | `ugrep -r -n --include='*.c' --include='*.h' -w '[A-Z]+_SUSPEND'` | 447 | 0.607s (9.62x) |
71
+ | [GNU grep](https://www.gnu.org/software/grep/) | `grep -E -r -n --include='*.c' --include='*.h' -w '[A-Z]+_SUSPEND'` | 447 | 0.674s (10.69x) |
72
+
73
+ Now we'll move to searching on single large file. Here is a straight-up
74
+ comparison between ripgrep, ugrep and GNU grep on a file cached in memory
75
+ (~13GB, [`OpenSubtitles.raw.en.gz`](http://opus.nlpl.eu/download.php?f=OpenSubtitles/v2018/mono/OpenSubtitles.raw.en.gz), decompressed):
76
+
77
+ | Tool | Command | Line count | Time |
78
+ | ---- | ------- | ---------- | ---- |
79
+ | ripgrep (Unicode) | `rg -w 'Sherlock [A-Z]\w+'` | 7882 | **1.042s** (1.00x) |
80
+ | [ugrep](https://github.com/Genivia/ugrep) | `ugrep -w 'Sherlock [A-Z]\w+'` | 7882 | 1.339s (1.28x) |
81
+ | [GNU grep (Unicode)](https://www.gnu.org/software/grep/) | `LC_ALL=en_US.UTF-8 egrep -w 'Sherlock [A-Z]\w+'` | 7882 | 6.577s (6.31x) |
82
+
83
+ In the above benchmark, passing the `-n` flag (for showing line numbers)
84
+ increases the times to `1.664s` for ripgrep and `9.484s` for GNU grep. ugrep
85
+ times are unaffected by the presence or absence of `-n`.
86
+
87
+ Beware of performance cliffs though:
88
+
89
+ | Tool | Command | Line count | Time |
90
+ | ---- | ------- | ---------- | ---- |
91
+ | ripgrep (Unicode) | `rg -w '[A-Z]\w+ Sherlock [A-Z]\w+'` | 485 | **1.053s** (1.00x) |
92
+ | [GNU grep (Unicode)](https://www.gnu.org/software/grep/) | `LC_ALL=en_US.UTF-8 grep -E -w '[A-Z]\w+ Sherlock [A-Z]\w+'` | 485 | 6.234s (5.92x) |
93
+ | [ugrep](https://github.com/Genivia/ugrep) | `ugrep -w '[A-Z]\w+ Sherlock [A-Z]\w+'` | 485 | 28.973s (27.51x) |
94
+
95
+ And performance can drop precipitously across the board when searching big
96
+ files for patterns without any opportunities for literal optimizations:
97
+
98
+ | Tool | Command | Line count | Time |
99
+ | ---- | ------- | ---------- | ---- |
100
+ | ripgrep | `rg '[A-Za-z]{30}'` | 6749 | **15.569s** (1.00x) |
101
+ | [ugrep](https://github.com/Genivia/ugrep) | `ugrep -E '[A-Za-z]{30}'` | 6749 | 21.857s (1.40x) |
102
+ | [GNU grep](https://www.gnu.org/software/grep/) | `LC_ALL=C grep -E '[A-Za-z]{30}'` | 6749 | 32.409s (2.08x) |
103
+ | [GNU grep (Unicode)](https://www.gnu.org/software/grep/) | `LC_ALL=en_US.UTF-8 grep -E '[A-Za-z]{30}'` | 6795 | 8m30s (32.74x) |
104
+
105
+ Finally, high match counts also tend to both tank performance and smooth
106
+ out the differences between tools (because performance is dominated by how
107
+ quickly one can handle a match and not the algorithm used to detect the match,
108
+ generally speaking):
109
+
110
+ | Tool | Command | Line count | Time |
111
+ | ---- | ------- | ---------- | ---- |
112
+ | ripgrep | `rg the` | 83499915 | **6.948s** (1.00x) |
113
+ | [ugrep](https://github.com/Genivia/ugrep) | `ugrep the` | 83499915 | 11.721s (1.69x) |
114
+ | [GNU grep](https://www.gnu.org/software/grep/) | `LC_ALL=C grep the` | 83499915 | 15.217s (2.19x) |
115
+
116
+ ### Why should I use ripgrep?
117
+
118
+ * It can replace many use cases served by other search tools
119
+ because it contains most of their features and is generally faster. (See
120
+ [the FAQ](FAQ.md#posix4ever) for more details on whether ripgrep can truly
121
+ replace grep.)
122
+ * Like other tools specialized to code search, ripgrep defaults to
123
+ [recursive search](GUIDE.md#recursive-search) and does [automatic
124
+ filtering](GUIDE.md#automatic-filtering). Namely, ripgrep won't search files
125
+ ignored by your `.gitignore`/`.ignore`/`.rgignore` files, it won't search
126
+ hidden files and it won't search binary files. Automatic filtering can be
127
+ disabled with `rg -uuu`.
128
+ * ripgrep can [search specific types of files](GUIDE.md#manual-filtering-file-types).
129
+ For example, `rg -tpy foo` limits your search to Python files and `rg -Tjs
130
+ foo` excludes JavaScript files from your search. ripgrep can be taught about
131
+ new file types with custom matching rules.
132
+ * ripgrep supports many features found in `grep`, such as showing the context
133
+ of search results, searching multiple patterns, highlighting matches with
134
+ color and full Unicode support. Unlike GNU grep, ripgrep stays fast while
135
+ supporting Unicode (which is always on).
136
+ * ripgrep has optional support for switching its regex engine to use PCRE2.
137
+ Among other things, this makes it possible to use look-around and
138
+ backreferences in your patterns, which are not supported in ripgrep's default
139
+ regex engine. PCRE2 support can be enabled with `-P/--pcre2` (use PCRE2
140
+ always) or `--auto-hybrid-regex` (use PCRE2 only if needed). An alternative
141
+ syntax is provided via the `--engine (default|pcre2|auto)` option.
142
+ * ripgrep has [rudimentary support for replacements](GUIDE.md#replacements),
143
+ which permit rewriting output based on what was matched.
144
+ * ripgrep supports [searching files in text encodings](GUIDE.md#file-encoding)
145
+ other than UTF-8, such as UTF-16, latin-1, GBK, EUC-JP, Shift_JIS and more.
146
+ (Some support for automatically detecting UTF-16 is provided. Other text
147
+ encodings must be specifically specified with the `-E/--encoding` flag.)
148
+ * ripgrep supports searching files compressed in a common format (brotli,
149
+ bzip2, gzip, lz4, lzma, xz, or zstandard) with the `-z/--search-zip` flag.
150
+ * ripgrep supports
151
+ [arbitrary input preprocessing filters](GUIDE.md#preprocessor)
152
+ which could be PDF text extraction, less supported decompression, decrypting,
153
+ automatic encoding detection and so on.
154
+ * ripgrep can be configured via a
155
+ [configuration file](GUIDE.md#configuration-file).
156
+
157
+ In other words, use ripgrep if you like speed, filtering by default, fewer
158
+ bugs and Unicode support.
159
+
160
+
161
+ ### Why shouldn't I use ripgrep?
162
+
163
+ Despite initially not wanting to add every feature under the sun to ripgrep,
164
+ over time, ripgrep has grown support for most features found in other file
165
+ searching tools. This includes searching for results spanning across multiple
166
+ lines, and opt-in support for PCRE2, which provides look-around and
167
+ backreference support.
168
+
169
+ At this point, the primary reasons not to use ripgrep probably consist of one
170
+ or more of the following:
171
+
172
+ * You need a portable and ubiquitous tool. While ripgrep works on Windows,
173
+ macOS and Linux, it is not ubiquitous and it does not conform to any
174
+ standard such as POSIX. The best tool for this job is good old grep.
175
+ * There still exists some other feature (or bug) not listed in this README that
176
+ you rely on that's in another tool that isn't in ripgrep.
177
+ * There is a performance edge case where ripgrep doesn't do well where another
178
+ tool does do well. (Please file a bug report!)
179
+ * ripgrep isn't possible to install on your machine or isn't available for your
180
+ platform. (Please file a bug report!)
181
+
182
+
183
+ ### Is it really faster than everything else?
184
+
185
+ Generally, yes. A large number of benchmarks with detailed analysis for each is
186
+ [available on my blog](https://blog.burntsushi.net/ripgrep/).
187
+
188
+ Summarizing, ripgrep is fast because:
189
+
190
+ * It is built on top of
191
+ [Rust's regex engine](https://github.com/rust-lang/regex).
192
+ Rust's regex engine uses finite automata, SIMD and aggressive literal
193
+ optimizations to make searching very fast. (PCRE2 support can be opted into
194
+ with the `-P/--pcre2` flag.)
195
+ * Rust's regex library maintains performance with full Unicode support by
196
+ building UTF-8 decoding directly into its deterministic finite automaton
197
+ engine.
198
+ * It supports searching with either memory maps or by searching incrementally
199
+ with an intermediate buffer. The former is better for single files and the
200
+ latter is better for large directories. ripgrep chooses the best searching
201
+ strategy for you automatically.
202
+ * Applies your ignore patterns in `.gitignore` files using a
203
+ [`RegexSet`](https://docs.rs/regex/1/regex/struct.RegexSet.html).
204
+ That means a single file path can be matched against multiple glob patterns
205
+ simultaneously.
206
+ * It uses a lock-free parallel recursive directory iterator, courtesy of
207
+ [`crossbeam`](https://docs.rs/crossbeam) and
208
+ [`ignore`](https://docs.rs/ignore).
209
+
210
+
211
+ ### Feature comparison
212
+
213
+ Andy Lester, author of [ack](https://beyondgrep.com/), has published an
214
+ excellent table comparing the features of ack, ag, git-grep, GNU grep and
215
+ ripgrep: https://beyondgrep.com/feature-comparison/
216
+
217
+ Note that ripgrep has grown a few significant new features recently that
218
+ are not yet present in Andy's table. This includes, but is not limited to,
219
+ configuration files, passthru, support for searching compressed files,
220
+ multiline search and opt-in fancy regex support via PCRE2.
221
+
222
+
223
+ ### Playground
224
+
225
+ If you'd like to try ripgrep before installing, there's an unofficial
226
+ [playground](https://codapi.org/ripgrep/) and an [interactive
227
+ tutorial](https://codapi.org/try/ripgrep/).
228
+
229
+ If you have any questions about these, please open an issue in the [tutorial
230
+ repo](https://github.com/nalgeon/tryxinyminutes).
231
+
232
+
233
+ ### Installation
234
+
235
+ The binary name for ripgrep is `rg`.
236
+
237
+ **[Archives of precompiled binaries for ripgrep are available for Windows,
238
+ macOS and Linux.](https://github.com/BurntSushi/ripgrep/releases)** Linux and
239
+ Windows binaries are static executables. Users of platforms not explicitly
240
+ mentioned below are advised to download one of these archives.
241
+
242
+ If you're a **macOS Homebrew** or a **Linuxbrew** user, then you can install
243
+ ripgrep from homebrew-core:
244
+
245
+ ```
246
+ $ brew install ripgrep
247
+ ```
248
+
249
+ If you're a **MacPorts** user, then you can install ripgrep from the
250
+ [official ports](https://www.macports.org/ports.php?by=name&substr=ripgrep):
251
+
252
+ ```
253
+ $ sudo port install ripgrep
254
+ ```
255
+
256
+ If you're a **Windows Chocolatey** user, then you can install ripgrep from the
257
+ [official repo](https://chocolatey.org/packages/ripgrep):
258
+
259
+ ```
260
+ $ choco install ripgrep
261
+ ```
262
+
263
+ If you're a **Windows Scoop** user, then you can install ripgrep from the
264
+ [official bucket](https://github.com/ScoopInstaller/Main/blob/master/bucket/ripgrep.json):
265
+
266
+ ```
267
+ $ scoop install ripgrep
268
+ ```
269
+
270
+ If you're a **Windows Winget** user, then you can install ripgrep from the
271
+ [winget-pkgs](https://github.com/microsoft/winget-pkgs/tree/master/manifests/b/BurntSushi/ripgrep)
272
+ repository:
273
+
274
+ ```
275
+ $ winget install BurntSushi.ripgrep.MSVC
276
+ ```
277
+
278
+ If you're an **Arch Linux** user, then you can install ripgrep from the official repos:
279
+
280
+ ```
281
+ $ sudo pacman -S ripgrep
282
+ ```
283
+
284
+ If you're a **Gentoo** user, you can install ripgrep from the
285
+ [official repo](https://packages.gentoo.org/packages/sys-apps/ripgrep):
286
+
287
+ ```
288
+ $ sudo emerge sys-apps/ripgrep
289
+ ```
290
+
291
+ If you're a **Fedora** user, you can install ripgrep from official
292
+ repositories.
293
+
294
+ ```
295
+ $ sudo dnf install ripgrep
296
+ ```
297
+
298
+ If you're an **openSUSE** user, ripgrep is included in **openSUSE Tumbleweed**
299
+ and **openSUSE Leap** since 15.1.
300
+
301
+ ```
302
+ $ sudo zypper install ripgrep
303
+ ```
304
+
305
+ If you're a **RHEL/CentOS 7/8** user, you can install ripgrep from
306
+ [copr](https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/):
307
+
308
+ ```
309
+ $ sudo yum install -y yum-utils
310
+ $ sudo yum-config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/repo/epel-7/carlwgeorge-ripgrep-epel-7.repo
311
+ $ sudo yum install ripgrep
312
+ ```
313
+
314
+ If you're a **Nix** user, you can install ripgrep from
315
+ [nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/text/ripgrep/default.nix):
316
+
317
+ ```
318
+ $ nix-env --install ripgrep
319
+ ```
320
+
321
+ If you're a **Flox** user, you can install ripgrep as follows:
322
+
323
+ ```
324
+ $ flox install ripgrep
325
+ ```
326
+
327
+ If you're a **Guix** user, you can install ripgrep from the official
328
+ package collection:
329
+
330
+ ```
331
+ $ guix install ripgrep
332
+ ```
333
+
334
+ If you're a **Debian** user (or a user of a Debian derivative like **Ubuntu**),
335
+ then ripgrep can be installed using a binary `.deb` file provided in each
336
+ [ripgrep release](https://github.com/BurntSushi/ripgrep/releases).
337
+
338
+ ```
339
+ $ curl -LO https://github.com/BurntSushi/ripgrep/releases/download/14.1.0/ripgrep_14.1.0-1_amd64.deb
340
+ $ sudo dpkg -i ripgrep_14.1.0-1_amd64.deb
341
+ ```
342
+
343
+ If you run Debian stable, ripgrep is [officially maintained by
344
+ Debian](https://tracker.debian.org/pkg/rust-ripgrep), although its version may
345
+ be older than the `deb` package available in the previous step.
346
+
347
+ ```
348
+ $ sudo apt-get install ripgrep
349
+ ```
350
+
351
+ If you're an **Ubuntu Cosmic (18.10)** (or newer) user, ripgrep is
352
+ [available](https://launchpad.net/ubuntu/+source/rust-ripgrep) using the same
353
+ packaging as Debian:
354
+
355
+ ```
356
+ $ sudo apt-get install ripgrep
357
+ ```
358
+
359
+ (N.B. Various snaps for ripgrep on Ubuntu are also available, but none of them
360
+ seem to work right and generate a number of very strange bug reports that I
361
+ don't know how to fix and don't have the time to fix. Therefore, it is no
362
+ longer a recommended installation option.)
363
+
364
+ If you're an **ALT** user, you can install ripgrep from the
365
+ [official repo](https://packages.altlinux.org/en/search?name=ripgrep):
366
+
367
+ ```
368
+ $ sudo apt-get install ripgrep
369
+ ```
370
+
371
+ If you're a **FreeBSD** user, then you can install ripgrep from the
372
+ [official ports](https://www.freshports.org/textproc/ripgrep/):
373
+
374
+ ```
375
+ $ sudo pkg install ripgrep
376
+ ```
377
+
378
+ If you're an **OpenBSD** user, then you can install ripgrep from the
379
+ [official ports](https://openports.se/textproc/ripgrep):
380
+
381
+ ```
382
+ $ doas pkg_add ripgrep
383
+ ```
384
+
385
+ If you're a **NetBSD** user, then you can install ripgrep from
386
+ [pkgsrc](https://pkgsrc.se/textproc/ripgrep):
387
+
388
+ ```
389
+ $ sudo pkgin install ripgrep
390
+ ```
391
+
392
+ If you're a **Haiku x86_64** user, then you can install ripgrep from the
393
+ [official ports](https://github.com/haikuports/haikuports/tree/master/sys-apps/ripgrep):
394
+
395
+ ```
396
+ $ sudo pkgman install ripgrep
397
+ ```
398
+
399
+ If you're a **Haiku x86_gcc2** user, then you can install ripgrep from the
400
+ same port as Haiku x86_64 using the x86 secondary architecture build:
401
+
402
+ ```
403
+ $ sudo pkgman install ripgrep_x86
404
+ ```
405
+
406
+ If you're a **Void Linux** user, then you can install ripgrep from the
407
+ [official repository](https://voidlinux.org/packages/?arch=x86_64&q=ripgrep):
408
+
409
+ ```
410
+ $ sudo xbps-install -Syv ripgrep
411
+ ```
412
+
413
+ If you're a **Rust programmer**, ripgrep can be installed with `cargo`.
414
+
415
+ * Note that the minimum supported version of Rust for ripgrep is **1.72.0**,
416
+ although ripgrep may work with older versions.
417
+ * Note that the binary may be bigger than expected because it contains debug
418
+ symbols. This is intentional. To remove debug symbols and therefore reduce
419
+ the file size, run `strip` on the binary.
420
+
421
+ ```
422
+ $ cargo install ripgrep
423
+ ```
424
+
425
+ Alternatively, one can use [`cargo
426
+ binstall`](https://github.com/cargo-bins/cargo-binstall) to install a ripgrep
427
+ binary directly from GitHub:
428
+
429
+ ```
430
+ $ cargo binstall ripgrep
431
+ ```
432
+
433
+
434
+ ### Building
435
+
436
+ ripgrep is written in Rust, so you'll need to grab a
437
+ [Rust installation](https://www.rust-lang.org/) in order to compile it.
438
+ ripgrep compiles with Rust 1.72.0 (stable) or newer. In general, ripgrep tracks
439
+ the latest stable release of the Rust compiler.
440
+
441
+ To build ripgrep:
442
+
443
+ ```
444
+ $ git clone https://github.com/BurntSushi/ripgrep
445
+ $ cd ripgrep
446
+ $ cargo build --release
447
+ $ ./target/release/rg --version
448
+ 0.1.3
449
+ ```
450
+
451
+ **NOTE:** In the past, ripgrep supported a `simd-accel` Cargo feature when
452
+ using a Rust nightly compiler. This only benefited UTF-16 transcoding.
453
+ Since it required unstable features, this build mode was prone to breakage.
454
+ Because of that, support for it has been removed. If you want SIMD
455
+ optimizations for UTF-16 transcoding, then you'll have to petition the
456
+ [`encoding_rs`](https://github.com/hsivonen/encoding_rs) project to use stable
457
+ APIs.
458
+
459
+ Finally, optional PCRE2 support can be built with ripgrep by enabling the
460
+ `pcre2` feature:
461
+
462
+ ```
463
+ $ cargo build --release --features 'pcre2'
464
+ ```
465
+
466
+ Enabling the PCRE2 feature works with a stable Rust compiler and will
467
+ attempt to automatically find and link with your system's PCRE2 library via
468
+ `pkg-config`. If one doesn't exist, then ripgrep will build PCRE2 from source
469
+ using your system's C compiler and then statically link it into the final
470
+ executable. Static linking can be forced even when there is an available PCRE2
471
+ system library by either building ripgrep with the MUSL target or by setting
472
+ `PCRE2_SYS_STATIC=1`.
473
+
474
+ ripgrep can be built with the MUSL target on Linux by first installing the MUSL
475
+ library on your system (consult your friendly neighborhood package manager).
476
+ Then you just need to add MUSL support to your Rust toolchain and rebuild
477
+ ripgrep, which yields a fully static executable:
478
+
479
+ ```
480
+ $ rustup target add x86_64-unknown-linux-musl
481
+ $ cargo build --release --target x86_64-unknown-linux-musl
482
+ ```
483
+
484
+ Applying the `--features` flag from above works as expected. If you want to
485
+ build a static executable with MUSL and with PCRE2, then you will need to have
486
+ `musl-gcc` installed, which might be in a separate package from the actual
487
+ MUSL library, depending on your Linux distribution.
488
+
489
+
490
+ ### Running tests
491
+
492
+ ripgrep is relatively well-tested, including both unit tests and integration
493
+ tests. To run the full test suite, use:
494
+
495
+ ```
496
+ $ cargo test --all
497
+ ```
498
+
499
+ from the repository root.
500
+
501
+
502
+ ### Related tools
503
+
504
+ * [delta](https://github.com/dandavison/delta) is a syntax highlighting
505
+ pager that supports the `rg --json` output format. So all you need to do to
506
+ make it work is `rg --json pattern | delta`. See [delta's manual section on
507
+ grep](https://dandavison.github.io/delta/grep.html) for more details.
508
+
509
+
510
+ ### Vulnerability reporting
511
+
512
+ For reporting a security vulnerability, please
513
+ [contact Andrew Gallant](https://blog.burntsushi.net/about/).
514
+ The contact page has my email address and PGP public key if you wish to send an
515
+ encrypted message.
516
+
517
+
518
+ ### Translations
519
+
520
+ The following is a list of known translations of ripgrep's documentation. These
521
+ are unofficially maintained and may not be up to date.
522
+
523
+ * [Chinese](https://github.com/chinanf-boy/ripgrep-zh#%E6%9B%B4%E6%96%B0-)
524
+ * [Spanish](https://github.com/UltiRequiem/traducciones/tree/master/ripgrep)
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <http://unlicense.org/>