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

836 Commits

Author SHA1 Message Date
dana
6dce04963d Allow options with non-numeric arguments to accept leading hyphens in arguments (fixes #568) 2017-07-30 17:55:24 -04:00
dana
d4b790fd8d Install zsh APT package 2017-07-26 09:30:14 -04:00
dana
9283dd122e Update test_complete to source completion function for more reliable options parsing 2017-07-26 09:30:14 -04:00
dana
4c41e9225b Make completion support short-option values in same word; handle debug variable 2017-07-26 09:30:14 -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
dana
5613df3034 Refactor zsh completion function
- 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
2017-07-18 07:03:36 -04:00
dana
79ad81626f Update test_complete.sh to avoid false positives related to shell syntax 2017-07-18 07:03:36 -04:00
Lincoln Atkinson
354a5cad97 Fix invisible file path text in PowerShell (#557)
change default path color on Windows

This avoids a conflict with a PowerShell configuration that causes text to be invisible.

Fixes #342
2017-07-17 18:01:13 -04:00
Andrew Gallant
92e5fad27d
ignore-0.2.2 2017-07-17 17:56:33 -04:00
Andrew Gallant
f86f987d71
benchsuite: fix another bug 2017-07-17 09:28:49 -04:00
Andrew Gallant
bfbd53eb92
benchsuite: fix bugs
This fixes a few bugs in the benchsuite script that have apparently
cropped up over time due to insufficient testing.

Fixes #558
2017-07-17 08:21:42 -04:00
Behnam Esfahbod
0668c74ed4 [ignore] Fix matched_path_or_any_parents() for patterns ending in slash
In `matched_path_or_any_parents()` implementation, we missed the point
that when we start walking up the tree, we have to set `is_dir` to
`true`, so path `ROOT/a/b/c` matches pattern `/a/`, although the
original path is not a dir.
2017-07-13 08:44:09 -04:00
Andrew Gallant
1c03298903
bump ignore version, take 2 2017-07-12 22:26:59 -04:00
Andrew Gallant
e0e8f26c56
bump ignore version 2017-07-12 22:26:23 -04:00
Andrew Gallant
f5337329f4
ignore-0.2.1 2017-07-12 22:08:53 -04:00
Behnam Esfahbod ✅
84f4b4ef68 [ignore] Add extensive test for gitignore matching (#551)
[ignore] tests and new matched_path_or_any_parents method

The test data (gitignore rules and expected result) is based on the test
repo at <https://github.com/behnam/gitignore-test>.

The new `matched_path_or_any_parents` method fixes a bug
in gitignore matching where rules of form `<dir>/*` result in ignoring
only first-level files, but no deep files. This is not correct, as `<dir>/*`
matches the first-level directories under `<dir>`, resulting all to be
ignored. The new method fixes it by trying to match all parents in the
path against the gitignore rules.

The new method is necessary because it necessarily entails a
performance hit for trying to match all parents.
2017-07-12 22:06:08 -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
Gabriel
9b3921098a Tweak long_version features output
This reuses the systemd convention of putting flags on a separate line.
All credit to okdana for the implementation.  Addresses #524.
2017-07-07 12:18:44 -04:00
dana
ad262f1146 Update --version output to show compile-time features
Fixes #524
2017-07-07 11:30:59 -04:00
dana
170c078440 Add -f to completions 2017-07-06 19:00:35 -04:00
dana
db044a058a Add test_complete.sh to CI tasks 2017-07-06 19:00:35 -04:00
dana
c1f8040b32 Add test_complete script to compare rg --help output to zsh completion function 2017-07-06 19:00:35 -04:00
Jordan Danford
c8a5a7a3f4 Fix minor grammar issues in docs for ignore::Walk 2017-07-06 06:58:14 -04:00
dana
dd3df0ded7 Add --iglob to zsh completion function 2017-07-03 08:21:38 -04:00
dana
62a182af78 Improve zsh completion function
- Add missing options
- Fix confusion between --count and --max-count
- Improve wording consistency (capitalisation, punctuation, contractions, &c.)
- Add completion for encodings
- Add completion for colour specs
- Add partial completion for type specs
2017-07-03 07:15:21 -04:00
Peter S Panov
4047d9db71 add --iglob flag
Working with Chris Stadler, implemented
https://github.com/BurntSushi/ripgrep/issues/163#issuecomment-300012592
2017-07-03 06:52:52 -04:00
Jordan Danford
4683a325fa Update version of ignore crate in README.md 2017-07-02 15:46:25 -04:00
Bryan Richter
b6f1e5db1a Add cabal files for Haskell packages 2017-06-27 16:24:02 -04:00
Andrew Gallant
9e51b18ac7
bump wincolor dep 2017-06-19 13:46:43 -04:00
Andrew Gallant
9d7b6eb09a
wincolor-0.1.4 2017-06-19 13:26:15 -04:00
Alex Crichton
7763c98188 wincolor: Re-fetch the console on all calls
The primary motivation for this commit was rust-lang/cargo#4189 where dropping a
`wincolor::Console` would call `CloseHandle` to close the console handle. Cargo
creates a few `Console` instances so it ended up closing stdout a little
earlier as intended!

The `GetStdHandle` function returns handles I believe aren't intended to be
closed (as there's no refcounting). I believe libstd doesn't close these
handles.

This commit also moves to calling `GetStdHandle` on demand which libstd changed
to doing so recently as well, preventing caching of stale handles that change
over time with calls to `SetStdHandle`.
2017-06-19 12:57:45 -04:00
Evan.Mattiza
06393f888c fix word boundary w/ capture group
fixes BurntSushi/ripgrep#506. Word boundary search as arg had unexpected
behavior. added capture group to regex to encapsulate 'or' option search and
prevent expansion and partial boundary finds.

Signed-off-by: Evan.Mattiza <emattiza@gmail.com>
2017-06-15 06:55:55 -04:00
Sid-Ali Teir
e0989ef13b add yocto file types 2017-06-12 19:02:21 -04:00
Gent Bajraj
45e850aff7 Add julia as file type 2017-06-12 11:39:19 -04:00
Eric Nielsen
f2d1c582a8 Use clap's overrides_with and default_value_if
to better organize options. These are the changes:
- color will have default value of "never" if --vimgrep is given,
  and only if no --color option is given
- last overrides previous: --line-number and --no-line-number, --heading
  and --no-heading, --with-filename and --no-filename, and --vimgrep and
  --count
- no heading will be show if --vimgrep is defined. This worked inside
  vim actually because heading is also only shown if tty is stdout
  (which is not the case when rg is called from vim).

Unfortunately, clap does not behave like a usual GNU/POSIX in some
cases, as reported in https://github.com/kbknapp/clap-rs/issues/970
and https://github.com/kbknapp/clap-rs/issues/976 (having all the bells
and whistles, on the other hand). So we still have issues like rg
failing when same argument is given more than once (unless for the few
ones marked with `multiple(true)`), or having unintuitive precedence
rules (and probably non-intentional, just there because of clap's
limitations) like:
- --no-filename over --vimgrep
- --no-line-number over --column, --pretty or --vimgrep
- --no-heading over --pretty
regardless of the order in which options where given, where the desired
behavior would be that the last option would override the previous ones
given.
2017-06-12 10:29:38 -04:00
Brian Gianforcaro
ab70815ea2 Add "msbuild" filetype for msbuild related files
This commit adds a "msbuild" filetype grouping, with
a few different file types being mapped to this grouping:

- MSBuild project files: .csproj, .vcxproj, .fsproj, .proj
- MSBuild shared property files: .props
- MSBuild shared targets files: .targets
2017-06-12 07:48:31 -04:00
Brian Gianforcaro
27f97db510 Add .inl as one of the c++ file typee definitions.
.inl files are often used by convention to include
both inline functions, or function templates.
2017-06-12 07:48:31 -04:00
Taryn Hill
506ad1f3cf Add a cshtml ignore type 2017-06-06 18:08:42 -04:00
Eric Nielsen
13235b596f Use uppercase for required argument names
This reverts a couple of changes introduced in 4c78ca8 and keeps the
`PATTERN` argument consistently uppercased, so error messages can look
like:

    error: The following required arguments were not provided:
        <PATTERN>
2017-06-01 20:41:04 -04:00
Fangrui Song
2628c8f38e Add Zsh completion file 2017-05-29 16:55:03 -04:00
Andrew Gallant
112b3c5e0a
Fix another bug in -o/--only-matching.
The handling of the -o/--only-matching was incorrect. We cannot ever
re-run regexes on a *subset* of a matched line, because it doesn't take
into account zero width assertions on the edges of the regex. This
occurs whenever an end user uses an assertion explicity, but also occurs
when one is used implicitly, e.g., with the `-w` flag.

This instead reuses the initial matched range from the first regex
match. We also apply this fix to coloring.

Fixes #493
2017-05-29 09:51:58 -04:00
Eric Nielsen
4c78ca8b70 Update help and man pages
Formatting of rg.1.md. Remove backticks from already indented code.
Add missing italic to some arguments, Replace -n by --line-number in
--pretty for better clarity. Add explicit example of `*.foo` instead of
`<glob>` in examples. Add vim information to --vimgrep.

In src/app.rs, also changed help text for pattern and regexp. Actually,
"multiple patterns may be given" was not true for the standalone
pattern.
2017-05-26 19:17:59 -04:00
Eric Nielsen
ff898cd105 Remove vestigial color function from src/args.rs
It's usage was replaced by the `color_choice` function. Also, `color`
was outdated, as it didn't include testing for the new "ansi" option.
2017-05-26 07:00:58 -04:00
Eric Nielsen
2c98e5ce1e Update documentation for --color ansi
In `src/app.rs`, change typo "When ansi used" to "When ansi is used".
Update man pages with missing `ansi` option for `--color`.
2017-05-25 18:58:11 -04:00
Eric Nielsen
1e3fc79949 Should show filename for one file with vimgrep
With vim configured with:

    set grepprg=rg\ --vimgrep
    set grepformat^=%f:%l:%c:%m

and running the command `:grep 'vimgrep' doc/rg.1`, the output should
be:

    doc/rg.1:446:8:.B \-\-vimgrep

but the actual output was:

    446:8:.B \-\-vimgrep

Same issue would happen if results only match one file. Ag behaves as
expected.
2017-05-24 23:12:16 -04:00
Eric Nielsen
d1bbc6956b Fix typo, should be 'mode' instead of 'more'
in man pages.
2017-05-24 17:51:42 -04:00
Manuel Vives
cd6c54f5f4 Add support for QMake files 2017-05-24 16:44:22 -04:00
Andrew Gallant
44c03f58bc
bump deps, redux
This only bumps the regex dependency. The new clap version causes a bump
in unicode-segmentation, which in turn requires a Rust 1.15, which is
above ripgrep's currently supported minimum Rust version of 1.12.
2017-05-21 15:56:56 -04:00
Andrew Gallant
d1a6ab922e
Revert "bump deps"
This reverts commit b860fa3acd.
2017-05-21 15:52:58 -04:00
Andrew Gallant
b860fa3acd
bump deps 2017-05-21 12:33:13 -04:00