summaryrefslogtreecommitdiffstats
path: root/complete
AgeCommit message (Collapse)Author
2021-05-31cli: add --field-{context,match}-separator flagsAnthony Huang
These flags permit configuring the bytes used to delimit fields in match or context lines, where "fields" are things like the file path, line number, column number and the match/context itself. Fixes #1842, Closes #1871
2021-05-31cli: add -. as short option for --hiddenJoão Marcos
This is somewhat non-standard, but it seems nice on the surface: short flag names are in short supply, --hidden is probably somewhat common and -. has an obvious connection with how hidden files are named on Unix. Closes #1680
2020-03-15ci: make script names consistentAndrew Gallant
2020-03-15cli: add --no-ignore-files flagAndrew Gallant
The purpose of this flag is to force ripgrep to ignore all --ignore-file flags (whether they come before or after --no-ignore-files). This flag can be overridden with --ignore-files. Fixes #1466
2020-03-15cli: add engine flagpierrenn
This permits switching between the different regex engine modes that ripgrep supports. The purpose of this flag is to make it easier to extend ripgrep with additional regex engines. Closes #1488, Closes #1502
2020-02-17cli: add --no-unicode, deprecate --no-pcre2-unicodeAndrew Gallant
This adds a universal --no-unicode flag that is intended to work for all supported regex engines. There is no point in retaining --no-pcre2-unicode, so we make them aliases to the new flags and deprecate them.
2020-02-17cli: add --no-require-git flagAndrew Gallant
This flag prevents ripgrep from requiring one to search a git repository in order to respect git-related ignore rules (global, .gitignore and local excludes). This actually corresponds to behavior ripgrep had long ago, but #934 changed that. It turns out that users were relying on this buggy behavior. In most cases, fixing it as simple as converting one's rules to .ignore or .rgignore files. Unfortunately, there are other use cases---like Perforce automatically respecting .gitignore files---that make a strong case for ripgrep to at least support this. The UX of a flag like this is absolutely atrocious. It's so obscure that it's really not worth explicitly calling it out anywhere. Moreover, the error cases that occur when this flag isn't used (but its behavior is desirable) will not be intuitive, do not seem easily detectable and will not guide users to this flag. Nevertheless, the motivation for this is just barely strong enough for me to begrudgingly accept this. Fixes #1414, Closes #1416
2020-02-17cli: add --no-ignore-exclude flagNaveen Nathan
This commit adds a new --no-ignore-exclude flag that permits disabling the use of .git/info/exclude filtering. Local exclusions are manual configurations to a repository and are not shared, so it is sometimes useful to disable to get a consistent view of a repository. This also adds a new section to the man page that describes automatic filtering. Closes #1420
2020-02-17cli: add --include-zero flagCollin Styles
This flag, when used in conjunction with --count or --count-matches, will print a result for each file searched even if there were zero matches in that file. This is off by default but can be enabled to make ripgrep behave more like grep. This also clarifies some of the defaults for the grep-printer::SummaryBuilder type. Closes #1370, Closes #1405
2020-02-17cli: add --no-context-separator flagMohammad AlSaleh
--context-separator='' still adds a new line separator, which could still potentially be useful. So we add a new `--no-context-separator` flag that completely disables context separators even when the -A/-B/-C context flags are used. Closes #1390
2019-08-01ripgrep: add --glob-case-insensitivedana
This flag forces -g/--glob patterns to be treated case-insensitively, as with --iglob patterns. Fixes #1293
2019-04-15complete: fix typoAndrew Gallant
2019-04-15ripgrep: max-column-preview --> max-columns-previewAndrew Gallant
Credit to @okdana for catching this. This naming is a bit more consistent with the existing --max-columns flag.
2019-04-14ripgrep: add --auto-hybrid-regex flagAndrew Gallant
This flag, when set, will automatically dispatch to PCRE2 if the given regex cannot be compiled by Rust's regex engine. If both engines fail to compile the regex, then both errors are surfaced. Closes #1155
2019-04-14ripgrep: add --pcre2-version flagAndrew Gallant
This flag will output details about the version of PCRE2 that ripgrep is using (if any).
2019-04-14ripgrep: add -I as a short option for --no-filenameAndrew Gallant
This flag is commonly used in pipelines and it can be annoying to write it out every time you need it. Ideally, we would use -h for this to match GNU grep, but -h is used to print help output. Closes #1185
2019-04-14printer: support previews for long linesAndrew Gallant
This commit adds support for showing a preview of long lines. While the default still remains as completely suppressing the entire line, this new functionality will show the first N graphemes of a matching line, including the number of matches that are suppressed. This was unfortunately a fairly invasive change to the printer that required a bit of refactoring. On the bright side, the single line and multi-line coloring are now more unified than they were before. Closes #1078
2019-04-14binary: rejigger ripgrep's handling of binary filesAndrew Gallant
This commit attempts to surface binary filtering in a slightly more user friendly way. Namely, before, ripgrep would silently stop searching a file if it detected a NUL byte, even if it had previously printed a match. This can lead to the user quite reasonably assuming that there are no more matches, since a partial search is fairly unintuitive. (ripgrep has this behavior by default because it really wants to NOT search binary files at all, just like it doesn't search gitignored or hidden files.) With this commit, if a match has already been printed and ripgrep detects a NUL byte, then it will print a warning message indicating that the search stopped prematurely. Moreover, this commit adds a new flag, --binary, which causes ripgrep to stop filtering binary files, but in a way that still avoids dumping binary data into terminals. That is, the --binary flag makes ripgrep behave more like grep's default behavior. For files explicitly specified in a search, e.g., `rg foo some-file`, then no binary filtering is applied (just like no gitignore and no hidden file filtering is applied). Instead, ripgrep behaves as if you gave the --binary flag for all explicitly given files. This was a fairly invasive change, and potentially increases the UX complexity of ripgrep around binary files. (Before, there were two binary modes, where as now there are three.) However, ripgrep is now a bit louder with warning messages when binary file detection might otherwise be hiding potential matches, so hopefully this is a net improvement. Finally, the `-uuu` convenience now maps to `--no-ignore --hidden --binary`, since this is closer to the actualy intent of the `--unrestricted` flag, i.e., to reduce ripgrep's smart filtering. As a consequence, `rg -uuu foo` should now search roughly the same number of bytes as `grep -r foo`, and `rg -uuua foo` should search roughly the same number of bytes as `grep -ra foo`. (The "roughly" weasel word is used because grep's and ripgrep's binary file detection might differ somewhat---perhaps based on buffer sizes---which can impact exactly what is and isn't searched.) See the numerous tests in tests/binary.rs for intended behavior. Fixes #306, Fixes #855
2019-04-06searcher: add option to disable BOM sniffinglesnyrumcajs
This commit adds a new encoding feature where the -E/--encoding flag will now accept a value of 'none'. When given this value, all encoding related machinery is disabled and ripgrep will search the raw bytes of the file, including the BOM if it's present. Closes #1207, Closes #1208
2019-01-26config: add --no-ignore-dot flagAndrew Gallant
This flag causes ripgrep to ignore `.ignore` files. Closes #1138
2019-01-22ripgrep: add --ignore-file-case-insensitiveDavid Torosyan
The --ignore-file-case-insensitive flag causes all .gitignore/.rgignore/.ignore files to have their globs matched without regard for case. Because this introduces a potentially significant performance regression, this is always disabled by default. Users that need case insensitive matching can enable it on a case by case basis. Closes #1164, Closes #1170
2018-09-04ripgrep: add --pre-glob flagAndrew Gallant
The --pre-glob flag is like the --glob flag, except it applies to filtering files through the preprocessor instead of for search. This makes it possible to apply the preprocessor to only a small subset of files, which can greatly reduce the process overhead of using a preprocessor when searching large directories.
2018-09-04ripgrep: add --line-buffered and --block-bufferedAndrew Gallant
These flags provide granular control over ripgrep's buffering strategy. The --line-buffered flag can be genuinely useful in certain types of shell pipelines. The --block-buffered flag has a murkier use case, but we add it for completeness.
2018-08-27complete: don't complete bare pattern after -fdana
2018-08-26ripgrep: add --sort and --sortr flagsAndrew Gallant
These flags each accept one of five choices: none, path, modified, accessed or created. The value indicates how the results are sorted. For --sort, results are sorted in ascending order where as for --sortr, results are sorted in descending order. Closes #404
2018-08-26ignore: add 'same_file_system' optionAndrew Gallant
This commit adds a 'same_file_system' option to the walk builder. For single threaded walking, it defers to the walkdir crate, which has the same option. The bulk of this commit implements this flag for the parallel walker. We add one very feeble test for this. The parallel walker is now officially a complete mess. Closes #321
2018-08-21ripgrep: make --no-pcre2-unicode the canonical flagAndrew Gallant
Previously, we used --pcre2-unicode as the canonical flag despite the fact that it is enabled by default, which is inconsistent with how we handle other similar flags. The reason why --pcre2-unicode was made the canonical flag was to make it easier to discover since it would be sorted near the --pcre2 flag. To solve that problem, we simply start a convention that lists related flags in the docs. Fixes #1022
2018-08-20complete: add completion reference guidedana
2018-08-20ripgrep: add --no-multiline-dotalldana
2018-08-20complete: update wording, exclusion, &c.dana
2018-08-20ripgrep: migrate to libripgrepAndrew Gallant
This commit does the work to delete the old `grep` crate and effectively rewrite most of ripgrep core to use the new libripgrep crates. The new `grep` crate is now a facade that collects the various crates that make up libripgrep. The most complex part of ripgrep core is now arguably the translation between command line parameters and the library options, which is ultimately where we want to be.
2018-07-24complete: add --no-pre, improve --pre/--search-zip exclusivitydana
2018-07-22ripgrep: add --no-ignore-global flagAndrew Gallant
This commit adds a new --no-ignore-global flag that permits disabling the use of global gitignore filtering. Global gitignores are generally found in `$HOME/.config/git/ignore`, but its location can be configured via git's `core.excludesFile` option. Closes #934
2018-07-21ripgrep: add --pre flagCharles Blake
The preprocessor flag accepts a command program and executes this program for every input file that is searched. Instead of searching the file directly, ripgrep will instead search the stdout contents of the program. Closes #978, Closes #981
2018-07-06complete: improve zsh completiondana
- Use groups with _arguments - Conditionally complete 'negation' options (--messages, --no-column, &c.) - Improve option exclusivity - Improve option descriptions - Improve completion of colour 'whens' - Improve completion of colour specs - Remove some unnecessary work-arounds - Use more idiomatic conventions
2018-06-25ripgrep: rename --maxdepth to --max-depthdana
We keep the old `--maxdepth` spelling to preserve backward compatibility. PR #967
2018-04-23output: remove --line-number-width flagAndrew Gallant
This commit does what no software project has ever done before: we've outright removed a flag with no possible way to recapture its functionality. This flag presents numerous problems in that it never really worked well in the first place, and completely falls over when ripgrep uses the --no-heading output format. Well meaning users want ripgrep to fix this by getting into the alignment business by buffering all output, but that is a line that I refuse to cross. Fixes #795
2018-04-23complete: add --no-ignore-messagesAndrew Gallant
2018-03-10output: add --stats flagBalaji Sivaraman
This commit provides basic support for a --stats flag, which will print various aggregate statistics about a search after all of the results have been printed. This is mostly intended to support a similar feature found in the Silver Searcher. Note though that we don't emit the total bytes searched; this is a first pass at an implementation and we can improve upon it later. Closes #411, Closes #799
2018-03-10search: add a --count-matches flagBalaji Sivaraman
This commit introduces a new flag, --count-matches, which will cause ripgrep to report a total count of all matches instead of a count of total lines matched. Closes #566, Closes #814
2018-03-10search: add -b/--byte-offset flagBalaji Sivaraman
This commit adds support for printing 0-based byte offset before each line. We handle corner cases such as `-o/--only-matching` and `-C/--context` as well. Closes #812
2018-02-20termcolor: add underline supportBalaji Sivaraman
This commit adds underline support to the termcolor crate, and exposes it through ripgrep. Fixes #798
2018-02-04config: add persistent configurationAndrew Gallant
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-01-30search: add support for searching compressed filesBalaji Sivaraman
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-11printer: add --passthru flagdana
The --passthru flag causes ripgrep to print every line, even if the line does not contain a match. This is a response to the common pattern of `^|foo` to match every line, while still highlighting things like `foo`. Fixes #740
2018-01-01printer: add support for line number alignmentBalaji Sivaraman
Closes #544
2017-09-06doc: clarify --with-filename behavior with --headingDan Fabulich
2017-08-09Add -x/--line-regexp (#520)dana
add -x/--line-regexp flag
2017-07-26Make completion support short-option values in same word; handle debug variabledana
2017-07-18Refactor zsh completion functiondana
- Improve documentation - Reorganise into functions - Order options lexicographically - Correct minor wording inconsistencies - Fix --count error - Fix --maxdepth error - Fix --path-separator error - Fix --version error - Adjust exclusivity for --files, -h, -j, -o, -r, -t, -T, -v, -V, &c. - Improve pattern-operand guard behaviour - Partially fix issue with colorspec state - Fix issue with typespec state - Add completion for <type>:include: sequence - Move licence info out of the way