1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-04-24 17:12:16 +02:00

doc: add note about inverted flags

Fixes #1091
This commit is contained in:
Andrew Gallant 2019-01-26 14:12:47 -05:00
parent 6d5dba85bd
commit bf842dbc7f
No known key found for this signature in database
GPG Key ID: B2E3A4923F8B0D44
2 changed files with 31 additions and 15 deletions

View File

@ -25,6 +25,8 @@ Bug fixes:
* [BUG #373](https://github.com/BurntSushi/ripgrep/issues/373), * [BUG #373](https://github.com/BurntSushi/ripgrep/issues/373),
[BUG #1098](https://github.com/BurntSushi/ripgrep/issues/1098): [BUG #1098](https://github.com/BurntSushi/ripgrep/issues/1098):
`**` is now accepted as valid syntax anywhere in a glob. `**` is now accepted as valid syntax anywhere in a glob.
* [BUG #1091](https://github.com/BurntSushi/ripgrep/issues/1091):
Add note about inverted flags to the man page.
* [BUG #1095](https://github.com/BurntSushi/ripgrep/issues/1095): * [BUG #1095](https://github.com/BurntSushi/ripgrep/issues/1095):
Fix corner cases involving the `--crlf` flag. Fix corner cases involving the `--crlf` flag.
* [BUG #1103](https://github.com/BurntSushi/ripgrep/issues/1103): * [BUG #1103](https://github.com/BurntSushi/ripgrep/issues/1103):

View File

@ -34,12 +34,12 @@ files/directories and binary files.
ripgrep's default regex engine uses finite automata and guarantees linear ripgrep's default regex engine uses finite automata and guarantees linear
time searching. Because of this, features like backreferences and arbitrary time searching. Because of this, features like backreferences and arbitrary
look-around are not supported. However, if ripgrep is built with PCRE2, then look-around are not supported. However, if ripgrep is built with PCRE2, then
the --pcre2 flag can be used to enable backreferences and look-around. the *--pcre2* flag can be used to enable backreferences and look-around.
ripgrep supports configuration files. Set RIPGREP_CONFIG_PATH to a ripgrep supports configuration files. Set *RIPGREP_CONFIG_PATH* to a
configuration file. The file can specify one shell argument per line. Lines configuration file. The file can specify one shell argument per line. Lines
starting with '#' are ignored. For more details, see the man page or the starting with *#* are ignored. For more details, see the man page or the
README. *README*.
REGEX SYNTAX REGEX SYNTAX
@ -52,10 +52,10 @@ https://docs.rs/regex/*/regex/bytes/index.html#syntax
To a first approximation, ripgrep uses Perl-like regexes without look-around or To a first approximation, ripgrep uses Perl-like regexes without look-around or
backreferences. This makes them very similar to the "extended" (ERE) regular backreferences. This makes them very similar to the "extended" (ERE) regular
expressions supported by `egrep`, but with a few additional features like expressions supported by *egrep*, but with a few additional features like
Unicode character classes. Unicode character classes.
If you're using ripgrep with the --pcre2 flag, then please consult If you're using ripgrep with the *--pcre2* flag, then please consult
https://www.pcre.org or the PCRE2 man pages for documentation on the supported https://www.pcre.org or the PCRE2 man pages for documentation on the supported
syntax. syntax.
@ -73,6 +73,16 @@ _PATH_::
OPTIONS OPTIONS
------- -------
Note that for many options, there exist flags to disable them. In some cases,
those flags are not listed in a first class way below. For example, the
*--column* flag (listed below) enables column numbers in ripgrep's output, but
the *--no-column* flag (not listed below) disables them. The reverse can also
exist. For example, the *--no-ignore* flag (listed below) disables ripgrep's
*gitignore* logic, but the *--ignore* flag (not listed below) enables it. These
flags are useful for overriding a ripgrep configuration file on the command
line. Each flag's documentation notes whether an inverted flag exists. In all
cases, the flag specified last takes precedence.
{OPTIONS} {OPTIONS}
@ -89,11 +99,11 @@ behavior. The format of the configuration file is an "rc" style and is very
simple. It is defined by two rules: simple. It is defined by two rules:
1. Every line is a shell argument, after trimming ASCII whitespace. 1. Every line is a shell argument, after trimming ASCII whitespace.
2. Lines starting with _#_ (optionally preceded by any amount of 2. Lines starting with *#* (optionally preceded by any amount of
ASCII whitespace) are ignored. ASCII whitespace) are ignored.
ripgrep will look for a single configuration file if and only if the 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_CONFIG_PATH* environment variable is set and is non-empty.
ripgrep will parse shell arguments from this file on startup and will 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 behave as if the arguments in this file were prepended to any explicit
arguments given to ripgrep on the command line. arguments given to ripgrep on the command line.
@ -155,20 +165,20 @@ SHELL COMPLETION
Shell completion files are included in the release tarball for Bash, Fish, Zsh Shell completion files are included in the release tarball for Bash, Fish, Zsh
and PowerShell. and PowerShell.
For *bash*, move `rg.bash` to `$XDG_CONFIG_HOME/bash_completion` For *bash*, move *rg.bash* to *$XDG_CONFIG_HOME/bash_completion*
or `/etc/bash_completion.d/`. or */etc/bash_completion.d/*.
For *fish*, move `rg.fish` to `$HOME/.config/fish/completions`. For *fish*, move *rg.fish* to *$HOME/.config/fish/completions*.
For *zsh*, move `_rg` to one of your `$fpath` directories. For *zsh*, move *_rg* to one of your *$fpath* directories.
CAVEATS CAVEATS
------- -------
ripgrep may abort unexpectedly when using default settings if it searches a ripgrep may abort unexpectedly when using default settings if it searches a
file that is simultaneously truncated. This behavior can be avoided by passing file that is simultaneously truncated. This behavior can be avoided by passing
the --no-mmap flag which will forcefully disable the use of memory maps in all the *--no-mmap* flag which will forcefully disable the use of memory maps in
cases. all cases.
VERSION VERSION
@ -180,7 +190,11 @@ HOMEPAGE
-------- --------
https://github.com/BurntSushi/ripgrep https://github.com/BurntSushi/ripgrep
Please report bugs and feature requests in the issue tracker. Please report bugs and feature requests in the issue tracker. Please do your
best to provide a reproducible test case for bugs. This should include the
corpus being searched, the *rg* command, the actual output and the expected
output. Please also include the output of running the same *rg* command but
with the *--debug* flag.
AUTHORS AUTHORS