1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
Commit Graph

73 Commits

Author SHA1 Message Date
Andrew Gallant
904c75bd30 doc: overhaul documentation
This commit cleans up the README and splits portions of it out into
a user guide (GUIDE.md) and a FAQ (FAQ.md). The README now provides a
small list of documentation "quick" links to various parts of the docs.

This commit also does a few other minor touchups.
2018-02-10 12:12:47 -05:00
Andrew Gallant
c57d0fb4e8 config: add persistent configuration
This commit adds support for reading configuration files that change
ripgrep's default behavior. The format of the configuration file is an
"rc" style and is very simple. It is defined by two rules:

  1. Every line is a shell argument, after trimming ASCII whitespace.
  2. Lines starting with '#' (optionally preceded by any amount of
     ASCII whitespace) are ignored.

ripgrep will look for a single configuration file if and only if the
RIPGREP_CONFIG_PATH environment variable is set and is non-empty.
ripgrep will parse shell arguments from this file on startup and will
behave as if the arguments in this file were prepended to any explicit
arguments given to ripgrep on the command line.

For example, if your ripgreprc file contained a single line:

    --smart-case

then the following command

    RIPGREP_CONFIG_PATH=wherever/.ripgreprc rg foo

would behave identically to the following command

    rg --smart-case foo

This commit also adds a new flag, --no-config, that when present will
suppress any and all support for configuration. This includes any future
support for auto-loading configuration files from pre-determined paths
(which this commit does not add).

Conflicts between configuration files and explicit arguments are handled
exactly like conflicts in the same command line invocation. That is,
this command:

    RIPGREP_CONFIG_PATH=wherever/.ripgreprc rg foo --case-sensitive

is exactly equivalent to

    rg --smart-case foo --case-sensitive

in which case, the --case-sensitive flag would override the --smart-case
flag.

Closes #196
2018-02-04 10:40:20 -05:00
Balaji Sivaraman
f007f940c5 search: add support for searching compressed files
This commit adds opt-in support for searching compressed files during
recursive search. This behavior is only enabled when the
`-z/--search-zip` flag is passed to ripgrep. When enabled, a limited set
of common compression formats are recognized via file extension, and a
new process is spawned to perform the decompression. ripgrep then
searches the stdout of that spawned process.

Closes #539
2018-01-30 09:13:53 -05:00
Sebastian Torres
f00625c3f4 readme: add Ubuntu install instructions 2018-01-12 18:44:28 -05:00
Igor Gnatenko
82d03b99cd readme: ripgrep is in Fedora 27
References: https://bodhi.fedoraproject.org/updates/FEDORA-2018-ca3c304458
2018-01-12 13:40:00 -05:00
Andrew Gallant
5aed0522e8
readme: update summary benchmarks 2018-01-08 19:21:23 -05:00
Andrew Gallant
85d463c0cc
readme: link to Andy Lester's feature comparison 2018-01-08 18:31:34 -05:00
Igor Gnatenko
75a4b7b361 remove reference to copr for F28+
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-01-07 16:57:51 -05:00
Igor Gnatenko
c687d3a7c0 trivial: update instructions for Fedora
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-01-07 16:48:48 -05:00
Jonas Stein
1374f15bdf full package name for Gentoo sys-apps/ripgrep 2017-11-22 06:58:43 -05:00
Reuben D'Netto
256aeb5546 Added example for --colors to README 2017-11-03 06:46:29 -04:00
Christoph Michelbach
c4732ca012 Correct spelling mistakes in readme file. 2017-11-01 07:09:34 -04:00
TJ Rana
a98156e71c Fix minor typos
Update name Mac OS X to macOS
2017-10-14 07:02:03 -04:00
dana
36091591f0 Add troubleshooting notes re: conflicting tools/aliases 2017-10-12 06:40:38 -04:00
Andrew Gallant
12ffcb4296
readme: clarify intro 2017-10-10 18:33:23 -04:00
Omer Katz
aebb132a86 Addressed code reivew. 2017-10-08 08:03:00 -04:00
Omer Katz
ab4b6ab9c3 Ripgrep installs from Linuxbrew just fine and works as expected.
Mentioned it in the README file :)
2017-10-08 08:03:00 -04:00
dana
58fb4f987e Update README to be more explicit about precompiled binaries (fixes #618) 2017-10-08 08:02:19 -04:00
Daniel Vergeylen
6b79349f83 Rewording README
Trial to stay consistent with rest of the text.
Rewording by native english.
2017-10-08 08:01:29 -04:00
Daniel Vergeylen
f858828f61 Update README
Notify user `cargo install ripgrep` contains debug symbols and informs how to stripe them.
2017-10-08 08:01:29 -04:00
Andrew Gallant
f9cbf7d3d4
tweak working 2017-09-04 11:15:14 -04:00
Andrew Gallant
30608f2444
readme: update minimum version 2017-08-23 23:08:21 -04:00
Leonardo Santagada
9f2b054550 fix profile showing command for powershell
change the profile showing command to one that matches the microsoft article linked, as its simpler and the old one didn't work at least on windows 10 creators edition.
2017-07-22 08:53:46 -04:00
Carl George
aeac85389d update COPR name
I switched Fedora usernames, so new builds will be at a different URL.
2017-07-08 07:57:58 -04:00
Fangrui Song
2628c8f38e Add Zsh completion file 2017-05-29 16:55:03 -04:00
Eli Miller
d2c7a76a3c Add Powershell tips and autocompletion instructions 2017-05-08 19:23:41 -04:00
Douman
9456d95e8f Add short note on Windows Tips 2017-04-09 08:32:23 -04:00
Andrew Gallant
46f94826fd Update whirlwind tour with encoding info.
Fixes #1
2017-03-14 08:22:37 -04:00
Andrew Gallant
68af3bbdc4 fix CHANGELOG link 2017-03-12 21:58:29 -04:00
Andrew Gallant
70b6bdb104 changelog 0.5.0 2017-03-12 21:57:50 -04:00
Andrew Gallant
8bbe58d623 Add support for additional text encodings.
This includes, but is not limited to, UTF-16, latin-1, GBK, EUC-JP and
Shift_JIS. (Courtesy of the `encoding_rs` crate.)

Specifically, this feature enables ripgrep to search files that are
encoded in an encoding other than UTF-8. The list of available encodings
is tied directly to what the `encoding_rs` crate supports, which is in
turn tied to the Encoding Standard. The full list of available encodings
can be found here: https://encoding.spec.whatwg.org/#concept-encoding-get

This pull request also introduces the notion that text encodings can be
automatically detected on a best effort basis. Currently, the only
support for this is checking for a UTF-16 bom. In all other cases, a
text encoding of `auto` (the default) implies a UTF-8 or ASCII
compatible source encoding. When a text encoding is otherwise specified,
it is unconditionally used for all files searched.

Since ripgrep's regex engine is fundamentally built on top of UTF-8,
this feature works by transcoding the files to be searched from their
source encoding to UTF-8. This transcoding only happens when:

1. `auto` is specified and a non-UTF-8 encoding is detected.
2. A specific encoding is given by end users (including UTF-8).

When transcoding occurs, errors are handled by automatically inserting
the Unicode replacement character. In this case, ripgrep's output is
guaranteed to be valid UTF-8 (excluding non-UTF-8 file paths, if they
are printed).

In all other cases, the source text is searched directly, which implies
an assumption that it is at least ASCII compatible, but where UTF-8 is
most useful. In this scenario, encoding errors are not detected. In this
case, ripgrep's output will match the input exactly, byte-for-byte.

This design may not be optimal in all cases, but it has some advantages:

1. In the happy path ("UTF-8 everywhere") remains happy. I have not been
   able to witness any performance regressions.
2. In the non-UTF-8 path, implementation complexity is kept relatively
   low. The cost here is transcoding itself. A potentially superior
   implementation might build decoding of any encoding into the regex
   engine itself. In particular, the fundamental problem with
   transcoding everything first is that literal optimizations are nearly
   negated.

Future work should entail improving the user experience. For example, we
might want to auto-detect more text encodings. A more elaborate UX
experience might permit end users to specify multiple text encodings,
although this seems hard to pull off in an ergonomic way.

Fixes #1
2017-03-12 19:54:48 -04:00
Jean-Marie Comets
50f7a60a8d Add "Known issues" section in README.md
Also document that ctrl-c doesn't restore the termcolor.
Fixes #347.
2017-03-08 10:18:19 -05:00
David Salter
df1bf4a042 Added Chocolatey to the installation list 2017-03-01 06:41:52 -05:00
Andrew Gallant
48a8a3a691 kick travis 2017-02-24 08:41:20 -05:00
Andrew Gallant
b1d1cd2366 note minimum Rust version 2017-01-14 08:51:30 -05:00
Andrew Gallant
a6a24bafb3 fix minimum Rust version 2017-01-09 20:02:29 -05:00
Andrew Gallant
db27a33827 remove redundant words 2017-01-09 20:01:26 -05:00
Andrew Gallant
083fb73790 add anti-pitch 2017-01-09 19:55:56 -05:00
Andrew Gallant
8f7b9be356 Add docs for shell completion files.
Add small howtos for installing shell completion files to the README and
the man page.

They are still incomplete. We're missing Zsh and PowerShell.

Fixes #262
2017-01-06 22:52:57 -05:00
YPCrumble
900ef0abc7 Update docs to explain use of -g and --files to search for paths. (#285)
Update docs to explain use of -g and --files to search for paths.

Fixes #284
2016-12-22 07:21:22 -05:00
Andrew Gallant
8396d3ffaa Make backreference support clear.
Fixes #268.
2016-12-12 07:03:37 -05:00
Andrew Gallant
a3a2f0be6a ucg author says it's not a bug per se 2016-11-06 19:45:18 -05:00
Andrew Gallant
58126ffe15 touchups 2016-11-06 18:51:00 -05:00
Andrew Gallant
17644a76c0 typo 2016-11-06 18:49:07 -05:00
Andrew Gallant
9cab076a72 touchups 2016-11-06 18:04:55 -05:00
Andrew Gallant
7aa9652f3c touchups 2016-11-06 18:02:45 -05:00
Andrew Gallant
7187f61ca8 touchups 2016-11-06 18:01:55 -05:00
Andrew Gallant
f869c58a5a touchups 2016-11-06 17:59:57 -05:00
Andrew Gallant
3538ba3577 Update README with more/updated benchmarks 2016-11-06 17:55:38 -05:00
Tim Harder
e4f83f3161 Add Gentoo info to the README 2016-11-01 22:03:00 -04:00