mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-03 05:32:04 -07:00
Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
699c76f45c | ||
|
de33003527 | ||
|
3e943636f4 | ||
|
3f515afbb4 | ||
|
30db03bb62 | ||
|
d66812102b | ||
|
86f8c3c818 | ||
|
5eb2ca4338 | ||
|
20bcb8d883 | ||
|
7282706b42 | ||
|
160f04894f | ||
|
0473df1ef5 | ||
|
301a3fd71d | ||
|
d12bdf35a5 | ||
|
08514e8e6c | ||
|
687e846944 | ||
|
b286fdcb88 | ||
|
e3959d67a6 | ||
|
7d475b0c70 | ||
|
42223047a8 | ||
|
42afb6faa5 | ||
|
c4a6733f3b | ||
|
9e04a8283c | ||
|
05b26d5986 | ||
|
506f046b8b | ||
|
ae592b11e3 | ||
|
a5e7f176f1 | ||
|
0428bd1bec |
@@ -1,5 +1,4 @@
|
|||||||
language: rust
|
language: rust
|
||||||
cache: cargo
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
|
33
CHANGELOG.md
33
CHANGELOG.md
@@ -1,3 +1,36 @@
|
|||||||
|
0.3.2
|
||||||
|
=====
|
||||||
|
Feature enhancements:
|
||||||
|
|
||||||
|
* Added or improved file type filtering for Less, Sass, stylus, Zsh
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
|
||||||
|
* [BUG #229](https://github.com/BurntSushi/ripgrep/issues/229):
|
||||||
|
Make smart case slightly less conservative.
|
||||||
|
* [BUG #247](https://github.com/BurntSushi/ripgrep/issues/247):
|
||||||
|
Clarify use of --heading/--no-heading.
|
||||||
|
* [BUG #251](https://github.com/BurntSushi/ripgrep/issues/251),
|
||||||
|
[BUG #264](https://github.com/BurntSushi/ripgrep/issues/264),
|
||||||
|
[BUG #267](https://github.com/BurntSushi/ripgrep/issues/267):
|
||||||
|
Fix matching bug caused by literal optimizations.
|
||||||
|
* [BUG #256](https://github.com/BurntSushi/ripgrep/issues/256):
|
||||||
|
Fix bug that caused `rg foo` and `rg foo/` to have different behavior
|
||||||
|
when `foo` was a symlink.
|
||||||
|
* [BUG #270](https://github.com/BurntSushi/ripgrep/issues/270):
|
||||||
|
Fix bug where patterns starting with a `-` couldn't be used with the
|
||||||
|
`-e/--regexp` flag. (This resolves a regression that was introduced in
|
||||||
|
ripgrep 0.3.0.)
|
||||||
|
|
||||||
|
|
||||||
|
0.3.1
|
||||||
|
=====
|
||||||
|
Bug fixes:
|
||||||
|
|
||||||
|
* [BUG #242](https://github.com/BurntSushi/ripgrep/issues/242):
|
||||||
|
ripgrep didn't respect `--colors foo:none` correctly. Now it does.
|
||||||
|
|
||||||
|
|
||||||
0.3.0
|
0.3.0
|
||||||
=====
|
=====
|
||||||
This is a new minor version release of ripgrep that includes two breaking
|
This is a new minor version release of ripgrep that includes two breaking
|
||||||
|
64
Cargo.lock
generated
64
Cargo.lock
generated
@@ -1,22 +1,22 @@
|
|||||||
[root]
|
[root]
|
||||||
name = "ripgrep"
|
name = "ripgrep"
|
||||||
version = "0.3.0"
|
version = "0.3.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytecount 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bytecount 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"clap 2.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clap 2.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ctrlc 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ctrlc 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"grep 0.1.4",
|
"grep 0.1.4",
|
||||||
"ignore 0.1.5",
|
"ignore 0.1.6",
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"memmap 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"memmap 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"termcolor 0.1.0",
|
"termcolor 0.1.1",
|
||||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -48,15 +48,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "2.18.0"
|
version = "2.19.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"strsim 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicode-segmentation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-segmentation 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
@@ -72,7 +72,7 @@ version = "2.0.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ version = "0.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ignore"
|
name = "ignore"
|
||||||
version = "0.1.5"
|
version = "0.1.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"globset 0.1.2",
|
"globset 0.1.2",
|
||||||
@@ -134,7 +134,7 @@ dependencies = [
|
|||||||
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"thread_local 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"thread_local 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"walkdir 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"walkdir 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -153,7 +153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.17"
|
version = "0.2.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -166,7 +166,7 @@ name = "memchr"
|
|||||||
version = "0.1.11"
|
version = "0.1.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -176,16 +176,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"fs2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fs2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num_cpus"
|
name = "num_cpus"
|
||||||
version = "1.1.0"
|
version = "1.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -213,7 +213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strsim"
|
name = "strsim"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -222,13 +222,13 @@ version = "0.2.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "termcolor"
|
name = "termcolor"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"wincolor 0.1.0",
|
"wincolor 0.1.0",
|
||||||
]
|
]
|
||||||
@@ -239,7 +239,7 @@ version = "2.0.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -248,7 +248,7 @@ version = "3.0.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -270,7 +270,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-segmentation"
|
name = "unicode-segmentation"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -303,7 +303,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "walkdir"
|
name = "walkdir"
|
||||||
version = "1.0.1"
|
version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@@ -333,7 +333,7 @@ dependencies = [
|
|||||||
"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"
|
"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"
|
||||||
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
|
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
|
||||||
"checksum bytecount 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49e3c21915578e2300b08d3c174a8ac887e0c6421dff86fdc4d741dc29e5d413"
|
"checksum bytecount 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49e3c21915578e2300b08d3c174a8ac887e0c6421dff86fdc4d741dc29e5d413"
|
||||||
"checksum clap 2.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "40046b8a004bf3ba43b9078bf4b9b6d1708406a234848f925dbd7160a374c8a8"
|
"checksum clap 2.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "956cee0b2427dd9e71129a509d1ef17a7f5df9f8253924074d7a5d79bc61851e"
|
||||||
"checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97"
|
"checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97"
|
||||||
"checksum ctrlc 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77f98bb69e3fefadcc5ca80a1368a55251f70295168203e01165bcaecb270891"
|
"checksum ctrlc 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77f98bb69e3fefadcc5ca80a1368a55251f70295168203e01165bcaecb270891"
|
||||||
"checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f"
|
"checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f"
|
||||||
@@ -341,26 +341,26 @@ dependencies = [
|
|||||||
"checksum fs2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "640001e1bd865c7c32806292822445af576a6866175b5225aa2087ca5e3de551"
|
"checksum fs2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "640001e1bd865c7c32806292822445af576a6866175b5225aa2087ca5e3de551"
|
||||||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
|
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
|
||||||
"checksum lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6abe0ee2e758cd6bc8a2cd56726359007748fbf4128da998b65d0b70f881e19b"
|
"checksum lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6abe0ee2e758cd6bc8a2cd56726359007748fbf4128da998b65d0b70f881e19b"
|
||||||
"checksum libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "044d1360593a78f5c8e5e710beccdc24ab71d1f01bc19a29bcacdba22e8475d8"
|
"checksum libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "a51822fc847e7a8101514d1d44e354ba2ffa7d4c194dcab48870740e327cac70"
|
||||||
"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
|
"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
|
||||||
"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"
|
"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"
|
||||||
"checksum memmap 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "065ce59af31c18ea2c419100bda6247dd4ec3099423202b12f0bd32e529fabd2"
|
"checksum memmap 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "065ce59af31c18ea2c419100bda6247dd4ec3099423202b12f0bd32e529fabd2"
|
||||||
"checksum num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8890e6084723d57d0df8d2720b0d60c6ee67d6c93e7169630e4371e88765dcad"
|
"checksum num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "55aabf4e2d6271a2e4e4c0f2ea1f5b07cc589cc1a9e9213013b54a76678ca4f3"
|
||||||
"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
|
"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
|
||||||
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
|
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
|
||||||
"checksum simd 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "63b5847c2d766ca7ce7227672850955802fabd779ba616aeabead4c2c3877023"
|
"checksum simd 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "63b5847c2d766ca7ce7227672850955802fabd779ba616aeabead4c2c3877023"
|
||||||
"checksum strsim 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "50c069df92e4b01425a8bf3576d5d417943a6a7272fbabaf5bd80b1aaa76442e"
|
"checksum strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c"
|
||||||
"checksum term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f7f5f3f71b0040cecc71af239414c23fd3c73570f5ff54cf50e03cef637f2a0"
|
"checksum term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f7f5f3f71b0040cecc71af239414c23fd3c73570f5ff54cf50e03cef637f2a0"
|
||||||
"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
|
"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
|
||||||
"checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a"
|
"checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a"
|
||||||
"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
|
"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
|
||||||
"checksum thread_local 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50057ca52c629a39aed52d8eb253800cb727875fa6fc7c4b1445f0ac3b50c27c"
|
"checksum thread_local 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50057ca52c629a39aed52d8eb253800cb727875fa6fc7c4b1445f0ac3b50c27c"
|
||||||
"checksum unicode-segmentation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b905d0fc2a1f0befd86b0e72e31d1787944efef9d38b9358a9e92a69757f7e3b"
|
"checksum unicode-segmentation 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c3bc443ded17b11305ffffe6b37e2076f328a5a8cb6aa877b1b98f77699e98b5"
|
||||||
"checksum unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6722facc10989f63ee0e20a83cd4e1714a9ae11529403ac7e0afd069abc39e"
|
"checksum unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6722facc10989f63ee0e20a83cd4e1714a9ae11529403ac7e0afd069abc39e"
|
||||||
"checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91"
|
"checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91"
|
||||||
"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f"
|
"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f"
|
||||||
"checksum vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac5efe5cb0fa14ec2f84f83c701c562ee63f6dcc680861b21d65c682adfb05f"
|
"checksum vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac5efe5cb0fa14ec2f84f83c701c562ee63f6dcc680861b21d65c682adfb05f"
|
||||||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||||
"checksum walkdir 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "98da26f00240118fbb7a06fa29579d1b39d34cd6e0505ea5c125b26d5260a967"
|
"checksum walkdir 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "dd7c16466ecc507c7cb5988db03e6eab4aaeab89a5c37a29251fcfd3ac9b7afe"
|
||||||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
||||||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
|
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ripgrep"
|
name = "ripgrep"
|
||||||
version = "0.3.0" #:version
|
version = "0.3.2" #:version
|
||||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||||
description = """
|
description = """
|
||||||
Line oriented search tool using Rust's regex library. Combines the raw
|
Line oriented search tool using Rust's regex library. Combines the raw
|
||||||
@@ -26,7 +26,7 @@ path = "tests/tests.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bytecount = "0.1.4"
|
bytecount = "0.1.4"
|
||||||
clap = "2.18"
|
clap = "~2.19.0"
|
||||||
ctrlc = "2.0"
|
ctrlc = "2.0"
|
||||||
env_logger = "0.3"
|
env_logger = "0.3"
|
||||||
grep = { version = "0.1.4", path = "grep" }
|
grep = { version = "0.1.4", path = "grep" }
|
||||||
|
16
build.rs
16
build.rs
@@ -3,6 +3,7 @@ extern crate clap;
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
|
|
||||||
|
use std::env;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
||||||
use clap::Shell;
|
use clap::Shell;
|
||||||
@@ -12,12 +13,15 @@ use clap::Shell;
|
|||||||
mod app;
|
mod app;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
fs::create_dir_all(env!("OUT_DIR")).unwrap();
|
let outdir = match env::var_os("OUT_DIR") {
|
||||||
|
None => return,
|
||||||
|
Some(outdir) => outdir,
|
||||||
|
};
|
||||||
|
fs::create_dir_all(&outdir).unwrap();
|
||||||
|
|
||||||
let mut app = app::app_short();
|
let mut app = app::app_short();
|
||||||
app.gen_completions("rg", Shell::Bash, env!("OUT_DIR"));
|
app.gen_completions("rg", Shell::Bash, &outdir);
|
||||||
app.gen_completions("rg", Shell::Fish, env!("OUT_DIR"));
|
app.gen_completions("rg", Shell::Fish, &outdir);
|
||||||
// Zsh seems to fail with a panic.
|
app.gen_completions("rg", Shell::Zsh, &outdir);
|
||||||
// app.gen_completions("rg", Shell::Zsh, env!("OUT_DIR"));
|
app.gen_completions("rg", Shell::PowerShell, &outdir);
|
||||||
app.gen_completions("rg", Shell::PowerShell, env!("OUT_DIR"));
|
|
||||||
}
|
}
|
||||||
|
@@ -16,11 +16,11 @@ mk_tarball() {
|
|||||||
local out_dir=$(pwd)
|
local out_dir=$(pwd)
|
||||||
local name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}"
|
local name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}"
|
||||||
mkdir "$td/$name"
|
mkdir "$td/$name"
|
||||||
|
mkdir "$td/$name/complete"
|
||||||
|
|
||||||
cp target/$TARGET/release/rg "$td/$name/"
|
cp target/$TARGET/release/rg "$td/$name/"
|
||||||
cp {doc/rg.1,README.md,UNLICENSE,COPYING,LICENSE-MIT} "$td/$name/"
|
cp {doc/rg.1,README.md,UNLICENSE,COPYING,LICENSE-MIT} "$td/$name/"
|
||||||
cp target/release/build/ripgrep-*/out/rg.* "$td/$name/"
|
cp target/$TARGET/release/build/ripgrep-*/out/{_rg,rg.bash-completion,rg.fish,_rg.ps1} "$td/$name/complete/"
|
||||||
cp target/release/build/ripgrep-*/out/_rg.* "$td/$name/"
|
|
||||||
|
|
||||||
pushd $td
|
pushd $td
|
||||||
tar czf "$out_dir/$name.tar.gz" *
|
tar czf "$out_dir/$name.tar.gz" *
|
||||||
|
8
doc/rg.1
8
doc/rg.1
@@ -222,13 +222,17 @@ This is the default when one file is searched.
|
|||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B \-\-heading
|
.B \-\-heading
|
||||||
Show the file name above clusters of matches from each file.
|
Show the file name above clusters of matches from each file instead of
|
||||||
|
showing the file name for every match.
|
||||||
This is the default mode at a tty.
|
This is the default mode at a tty.
|
||||||
.RS
|
.RS
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B \-\-no\-heading
|
.B \-\-no\-heading
|
||||||
Don\[aq]t show any file name heading.
|
Don\[aq]t group matches by each file.
|
||||||
|
If \-H/\-\-with\-filename is enabled, then file names will be shown for
|
||||||
|
every line matched.
|
||||||
|
This is the default more when not at a tty.
|
||||||
.RS
|
.RS
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
|
@@ -147,11 +147,13 @@ Project home page: https://github.com/BurntSushi/ripgrep
|
|||||||
one file is searched.
|
one file is searched.
|
||||||
|
|
||||||
--heading
|
--heading
|
||||||
: Show the file name above clusters of matches from each file.
|
: Show the file name above clusters of matches from each file instead of
|
||||||
This is the default mode at a tty.
|
showing the file name for every match. This is the default mode at a tty.
|
||||||
|
|
||||||
--no-heading
|
--no-heading
|
||||||
: Don't show any file name heading.
|
: Don't group matches by each file. If -H/--with-filename is enabled, then
|
||||||
|
file names will be shown for every line matched. This is the default more
|
||||||
|
when not at a tty.
|
||||||
|
|
||||||
--hidden
|
--hidden
|
||||||
: Search hidden directories and files. (Hidden directories and files are
|
: Search hidden directories and files. (Hidden directories and files are
|
||||||
|
@@ -79,12 +79,12 @@ impl LiteralSets {
|
|||||||
debug!("required literals found: {:?}", req_lits);
|
debug!("required literals found: {:?}", req_lits);
|
||||||
let alts: Vec<String> =
|
let alts: Vec<String> =
|
||||||
req_lits.into_iter().map(|x| bytes_to_regex(x)).collect();
|
req_lits.into_iter().map(|x| bytes_to_regex(x)).collect();
|
||||||
Some(RegexBuilder::new(&alts.join("|")))
|
Some(RegexBuilder::new(&alts.join("|")).unicode(false))
|
||||||
} else if lit.is_empty() {
|
} else if lit.is_empty() {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
debug!("required literal found: {:?}", show(lit));
|
debug!("required literal found: {:?}", show(lit));
|
||||||
Some(RegexBuilder::new(&bytes_to_regex(lit)))
|
Some(RegexBuilder::new(&bytes_to_regex(&lit)).unicode(false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -167,14 +167,13 @@ impl GrepBuilder {
|
|||||||
/// Creates a new regex from the given expression with the current
|
/// Creates a new regex from the given expression with the current
|
||||||
/// configuration.
|
/// configuration.
|
||||||
fn regex(&self, expr: &Expr) -> Result<Regex> {
|
fn regex(&self, expr: &Expr) -> Result<Regex> {
|
||||||
self.regex_build(RegexBuilder::new(&expr.to_string()))
|
self.regex_build(RegexBuilder::new(&expr.to_string()).unicode(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Builds a new regex from the given builder using the caller's settings.
|
/// Builds a new regex from the given builder using the caller's settings.
|
||||||
fn regex_build(&self, builder: RegexBuilder) -> Result<Regex> {
|
fn regex_build(&self, builder: RegexBuilder) -> Result<Regex> {
|
||||||
builder
|
builder
|
||||||
.multi_line(true)
|
.multi_line(true)
|
||||||
.unicode(true)
|
|
||||||
.size_limit(self.opts.size_limit)
|
.size_limit(self.opts.size_limit)
|
||||||
.dfa_size_limit(self.opts.dfa_size_limit)
|
.dfa_size_limit(self.opts.dfa_size_limit)
|
||||||
.compile()
|
.compile()
|
||||||
@@ -318,12 +317,29 @@ impl<'b, 's> Iterator for Iter<'b, 's> {
|
|||||||
|
|
||||||
fn has_uppercase_literal(expr: &Expr) -> bool {
|
fn has_uppercase_literal(expr: &Expr) -> bool {
|
||||||
use syntax::Expr::*;
|
use syntax::Expr::*;
|
||||||
|
fn byte_is_upper(b: u8) -> bool { b'A' <= b && b <= b'Z' }
|
||||||
match *expr {
|
match *expr {
|
||||||
Literal { ref chars, casei } => {
|
Literal { ref chars, casei } => {
|
||||||
casei || chars.iter().any(|c| c.is_uppercase())
|
casei || chars.iter().any(|c| c.is_uppercase())
|
||||||
}
|
}
|
||||||
LiteralBytes { ref bytes, casei } => {
|
LiteralBytes { ref bytes, casei } => {
|
||||||
casei || bytes.iter().any(|&b| b'A' <= b && b <= b'Z')
|
casei || bytes.iter().any(|&b| byte_is_upper(b))
|
||||||
|
}
|
||||||
|
Class(ref ranges) => {
|
||||||
|
for r in ranges {
|
||||||
|
if r.start.is_uppercase() || r.end.is_uppercase() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
ClassBytes(ref ranges) => {
|
||||||
|
for r in ranges {
|
||||||
|
if byte_is_upper(r.start) || byte_is_upper(r.end) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
}
|
}
|
||||||
Group { ref e, .. } => has_uppercase_literal(e),
|
Group { ref e, .. } => has_uppercase_literal(e),
|
||||||
Repeat { ref e, .. } => has_uppercase_literal(e),
|
Repeat { ref e, .. } => has_uppercase_literal(e),
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ignore"
|
name = "ignore"
|
||||||
version = "0.1.5" #:version
|
version = "0.1.6" #:version
|
||||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||||
description = """
|
description = """
|
||||||
A fast library for efficiently matching ignore files such as `.gitignore`
|
A fast library for efficiently matching ignore files such as `.gitignore`
|
||||||
|
@@ -123,6 +123,7 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
|
|||||||
]),
|
]),
|
||||||
("json", &["*.json"]),
|
("json", &["*.json"]),
|
||||||
("jsonl", &["*.jsonl"]),
|
("jsonl", &["*.jsonl"]),
|
||||||
|
("less", &["*.less"]),
|
||||||
("lisp", &["*.el", "*.jl", "*.lisp", "*.lsp", "*.sc", "*.scm"]),
|
("lisp", &["*.el", "*.jl", "*.lisp", "*.lsp", "*.sc", "*.scm"]),
|
||||||
("lua", &["*.lua"]),
|
("lua", &["*.lua"]),
|
||||||
("m4", &["*.ac", "*.m4"]),
|
("m4", &["*.ac", "*.m4"]),
|
||||||
@@ -148,9 +149,11 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
|
|||||||
("rst", &["*.rst"]),
|
("rst", &["*.rst"]),
|
||||||
("ruby", &["*.rb"]),
|
("ruby", &["*.rb"]),
|
||||||
("rust", &["*.rs"]),
|
("rust", &["*.rs"]),
|
||||||
|
("sass", &["*.scss"]),
|
||||||
("scala", &["*.scala"]),
|
("scala", &["*.scala"]),
|
||||||
("sh", &["*.bash", "*.csh", "*.ksh", "*.sh", "*.tcsh"]),
|
("sh", &["*.bash", "*.csh", "*.ksh", "*.sh", "*.tcsh"]),
|
||||||
("spark", &["*.spark"]),
|
("spark", &["*.spark"]),
|
||||||
|
("stylus", &["*.styl"]),
|
||||||
("sql", &["*.sql"]),
|
("sql", &["*.sql"]),
|
||||||
("sv", &["*.v", "*.vg", "*.sv", "*.svh", "*.h"]),
|
("sv", &["*.v", "*.vg", "*.sv", "*.svh", "*.h"]),
|
||||||
("swift", &["*.swift"]),
|
("swift", &["*.swift"]),
|
||||||
@@ -168,6 +171,7 @@ const DEFAULT_TYPES: &'static [(&'static str, &'static [&'static str])] = &[
|
|||||||
("xml", &["*.xml"]),
|
("xml", &["*.xml"]),
|
||||||
("yacc", &["*.y"]),
|
("yacc", &["*.y"]),
|
||||||
("yaml", &["*.yaml", "*.yml"]),
|
("yaml", &["*.yaml", "*.yml"]),
|
||||||
|
("zsh", &["zshenv", ".zshenv", "zprofile", ".zprofile", "zshrc", ".zshrc", "zlogin", ".zlogin", "zlogout", ".zlogout", "*.zsh"]),
|
||||||
];
|
];
|
||||||
|
|
||||||
/// Glob represents a single glob in a set of file type definitions.
|
/// Glob represents a single glob in a set of file type definitions.
|
||||||
|
@@ -275,18 +275,6 @@ impl DirEntryRaw {
|
|||||||
depth: depth,
|
depth: depth,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn from_path(depth: usize, pb: PathBuf) -> Result<DirEntryRaw, Error> {
|
|
||||||
let md = try!(fs::symlink_metadata(&pb).map_err(|err| {
|
|
||||||
Error::Io(err).with_path(&pb)
|
|
||||||
}));
|
|
||||||
Ok(DirEntryRaw {
|
|
||||||
path: pb,
|
|
||||||
ty: md.file_type(),
|
|
||||||
follow_link: false,
|
|
||||||
depth: depth,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// WalkBuilder builds a recursive directory iterator.
|
/// WalkBuilder builds a recursive directory iterator.
|
||||||
@@ -756,7 +744,7 @@ impl WalkParallel {
|
|||||||
if path == Path::new("-") {
|
if path == Path::new("-") {
|
||||||
DirEntry::new_stdin()
|
DirEntry::new_stdin()
|
||||||
} else {
|
} else {
|
||||||
match DirEntryRaw::from_path(0, path) {
|
match DirEntryRaw::from_link(0, path) {
|
||||||
Ok(dent) => DirEntry::new_raw(dent, None),
|
Ok(dent) => DirEntry::new_raw(dent, None),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
if f(Err(err)).is_quit() {
|
if f(Err(err)).is_quit() {
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
class RipgrepBin < Formula
|
class RipgrepBin < Formula
|
||||||
version '0.2.8'
|
version '0.3.0'
|
||||||
desc "Search tool like grep and The Silver Searcher."
|
desc "Search tool like grep and The Silver Searcher."
|
||||||
homepage "https://github.com/BurntSushi/ripgrep"
|
homepage "https://github.com/BurntSushi/ripgrep"
|
||||||
url "https://github.com/BurntSushi/ripgrep/releases/download/#{version}/ripgrep-#{version}-x86_64-apple-darwin.tar.gz"
|
url "https://github.com/BurntSushi/ripgrep/releases/download/#{version}/ripgrep-#{version}-x86_64-apple-darwin.tar.gz"
|
||||||
sha256 "349aba7561028e869932bae8fd27cd5ce45a68f47f05d426d6701a50a8474aa0"
|
sha256 "a177195e31a6687e1b0141cbb93bb2fc915a49c4bca26d7094a8144ebdfb3a69"
|
||||||
|
|
||||||
conflicts_with "ripgrep"
|
conflicts_with "ripgrep"
|
||||||
|
|
||||||
|
11
src/app.rs
11
src/app.rs
@@ -1,6 +1,6 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use clap::{App, AppSettings, Arg};
|
use clap::{App, AppSettings, Arg, ArgSettings};
|
||||||
|
|
||||||
const ABOUT: &'static str = "
|
const ABOUT: &'static str = "
|
||||||
ripgrep (rg) recursively searches your current directory for a regex pattern.
|
ripgrep (rg) recursively searches your current directory for a regex pattern.
|
||||||
@@ -74,6 +74,7 @@ fn app<F>(next_line_help: bool, doc: F) -> App<'static, 'static>
|
|||||||
.arg(arg("path").multiple(true))
|
.arg(arg("path").multiple(true))
|
||||||
.arg(flag("regexp").short("e")
|
.arg(flag("regexp").short("e")
|
||||||
.takes_value(true).multiple(true).number_of_values(1)
|
.takes_value(true).multiple(true).number_of_values(1)
|
||||||
|
.set(ArgSettings::AllowLeadingHyphen)
|
||||||
.value_name("pattern"))
|
.value_name("pattern"))
|
||||||
.arg(flag("files")
|
.arg(flag("files")
|
||||||
// This should also conflict with `pattern`, but the first file
|
// This should also conflict with `pattern`, but the first file
|
||||||
@@ -338,11 +339,13 @@ lazy_static! {
|
|||||||
doc!(h, "heading",
|
doc!(h, "heading",
|
||||||
"Show matches grouped by each file.",
|
"Show matches grouped by each file.",
|
||||||
"This shows the file name above clusters of matches from each \
|
"This shows the file name above clusters of matches from each \
|
||||||
file. This is the default mode at a tty.");
|
file instead of showing the file name for every match. This is \
|
||||||
|
the default mode at a tty.");
|
||||||
doc!(h, "no-heading",
|
doc!(h, "no-heading",
|
||||||
"Don't group matches by each file.",
|
"Don't group matches by each file.",
|
||||||
"Don't group matches by each file. This is the default mode \
|
"Don't group matches by each file. If -H/--with-filename is \
|
||||||
when not at a tty.");
|
enabled, then file names will be shown for every line matched. \
|
||||||
|
This is the default mode when not at a tty.");
|
||||||
doc!(h, "hidden",
|
doc!(h, "hidden",
|
||||||
"Search hidden files and directories.",
|
"Search hidden files and directories.",
|
||||||
"Search hidden files and directories. By default, hidden files \
|
"Search hidden files and directories. By default, hidden files \
|
||||||
|
@@ -64,7 +64,7 @@ pub type Result<T> = result::Result<T, Box<Error + Send + Sync>>;
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match Args::parse().map(Arc::new).and_then(run) {
|
match Args::parse().map(Arc::new).and_then(run) {
|
||||||
Ok(count) if count == 0 => process::exit(1),
|
Ok(0) => process::exit(1),
|
||||||
Ok(_) => process::exit(0),
|
Ok(_) => process::exit(0),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
eprintln!("{}", err);
|
eprintln!("{}", err);
|
||||||
|
@@ -260,7 +260,7 @@ impl<W: WriteColor> Printer<W> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn write_matched_line(&mut self, re: &Regex, buf: &[u8]) {
|
fn write_matched_line(&mut self, re: &Regex, buf: &[u8]) {
|
||||||
if !self.wtr.supports_color() {
|
if !self.wtr.supports_color() || self.colors.matched().is_none() {
|
||||||
self.write(buf);
|
self.write(buf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "termcolor"
|
name = "termcolor"
|
||||||
version = "0.1.0" #:version
|
version = "0.1.1" #:version
|
||||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||||
description = """
|
description = """
|
||||||
A simple cross platform library for writing colored text to a terminal.
|
A simple cross platform library for writing colored text to a terminal.
|
||||||
|
@@ -764,7 +764,7 @@ impl<W: io::Write> WriteColor for Ansi<W> {
|
|||||||
if let Some(ref c) = spec.bg_color {
|
if let Some(ref c) = spec.bg_color {
|
||||||
try!(self.write_color(false, c, spec.bold));
|
try!(self.write_color(false, c, spec.bold));
|
||||||
}
|
}
|
||||||
if spec.fg_color.is_none() && spec.bg_color.is_none() {
|
if spec.bold && spec.fg_color.is_none() && spec.bg_color.is_none() {
|
||||||
try!(self.write_str("\x1B[1m"));
|
try!(self.write_str("\x1B[1m"));
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -969,6 +969,11 @@ impl ColorSpec {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if this color specification has no colors or styles.
|
||||||
|
pub fn is_none(&self) -> bool {
|
||||||
|
self.fg_color.is_none() && self.bg_color.is_none() && !self.bold
|
||||||
|
}
|
||||||
|
|
||||||
/// Clears this color specification so that it has no color/style settings.
|
/// Clears this color specification so that it has no color/style settings.
|
||||||
pub fn clear(&mut self) {
|
pub fn clear(&mut self) {
|
||||||
self.fg_color = None;
|
self.fg_color = None;
|
||||||
|
@@ -929,6 +929,45 @@ clean!(regression_228, "test", ".", |wd: WorkDir, mut cmd: Command| {
|
|||||||
wd.assert_err(&mut cmd);
|
wd.assert_err(&mut cmd);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// See: https://github.com/BurntSushi/ripgrep/issues/229
|
||||||
|
clean!(regression_229, "[E]conomie", ".", |wd: WorkDir, mut cmd: Command| {
|
||||||
|
wd.create("foo", "economie");
|
||||||
|
cmd.arg("-S");
|
||||||
|
wd.assert_err(&mut cmd);
|
||||||
|
});
|
||||||
|
|
||||||
|
// See: https://github.com/BurntSushi/ripgrep/issues/251
|
||||||
|
clean!(regression_251, "привет", ".", |wd: WorkDir, mut cmd: Command| {
|
||||||
|
wd.create("foo", "привет\nПривет\nПрИвЕт");
|
||||||
|
cmd.arg("-i");
|
||||||
|
|
||||||
|
let lines: String = wd.stdout(&mut cmd);
|
||||||
|
assert_eq!(lines, "foo:привет\nfoo:Привет\nfoo:ПрИвЕт\n");
|
||||||
|
});
|
||||||
|
|
||||||
|
// See: https://github.com/BurntSushi/ripgrep/issues/256
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
clean!(regression_256, "test", "foo", |wd: WorkDir, mut cmd: Command| {
|
||||||
|
wd.create_dir("bar");
|
||||||
|
wd.create("bar/baz", "test");
|
||||||
|
wd.link_dir("bar", "foo");
|
||||||
|
|
||||||
|
let lines: String = wd.stdout(&mut cmd);
|
||||||
|
assert_eq!(lines, "foo/baz:test\n");
|
||||||
|
});
|
||||||
|
|
||||||
|
// See: https://github.com/BurntSushi/ripgrep/issues/256
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
clean!(regression_256_j1, "test", "foo", |wd: WorkDir, mut cmd: Command| {
|
||||||
|
wd.create_dir("bar");
|
||||||
|
wd.create("bar/baz", "test");
|
||||||
|
wd.link_dir("bar", "foo");
|
||||||
|
cmd.arg("-j1");
|
||||||
|
|
||||||
|
let lines: String = wd.stdout(&mut cmd);
|
||||||
|
assert_eq!(lines, "foo/baz:test\n");
|
||||||
|
});
|
||||||
|
|
||||||
// See: https://github.com/BurntSushi/ripgrep/issues/7
|
// See: https://github.com/BurntSushi/ripgrep/issues/7
|
||||||
sherlock!(feature_7, "-fpat", "sherlock", |wd: WorkDir, mut cmd: Command| {
|
sherlock!(feature_7, "-fpat", "sherlock", |wd: WorkDir, mut cmd: Command| {
|
||||||
wd.create("pat", "Sherlock\nHolmes");
|
wd.create("pat", "Sherlock\nHolmes");
|
||||||
@@ -1224,6 +1263,18 @@ fn regression_64() {
|
|||||||
assert_eq!(lines, path("foo/abc\n"));
|
assert_eq!(lines, path("foo/abc\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See: https://github.com/BurntSushi/ripgrep/issues/270
|
||||||
|
#[test]
|
||||||
|
fn regression_270() {
|
||||||
|
let wd = WorkDir::new("regression_270");
|
||||||
|
wd.create("foo", "-test");
|
||||||
|
|
||||||
|
let mut cmd = wd.command();
|
||||||
|
cmd.arg("-e").arg("-test");
|
||||||
|
let lines: String = wd.stdout(&mut cmd);
|
||||||
|
assert_eq!(lines, path("foo:-test\n"));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn type_list() {
|
fn type_list() {
|
||||||
let wd = WorkDir::new("type_list");
|
let wd = WorkDir::new("type_list");
|
||||||
|
Reference in New Issue
Block a user