2016-02-27 18:07:26 +02:00
|
|
|
[package]
|
2016-09-08 22:15:44 +02:00
|
|
|
name = "ripgrep"
|
2017-01-14 06:46:21 +02:00
|
|
|
version = "0.4.0" #:version
|
2016-02-27 18:07:26 +02:00
|
|
|
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
|
|
|
description = """
|
2016-09-14 03:16:18 +02:00
|
|
|
Line oriented search tool using Rust's regex library. Combines the raw
|
|
|
|
performance of grep with the usability of the silver searcher.
|
2016-02-27 18:07:26 +02:00
|
|
|
"""
|
2016-09-08 22:15:44 +02:00
|
|
|
documentation = "https://github.com/BurntSushi/ripgrep"
|
|
|
|
homepage = "https://github.com/BurntSushi/ripgrep"
|
|
|
|
repository = "https://github.com/BurntSushi/ripgrep"
|
2016-02-27 18:07:26 +02:00
|
|
|
readme = "README.md"
|
|
|
|
keywords = ["regex", "grep", "egrep", "search", "pattern"]
|
2017-01-20 21:20:28 +02:00
|
|
|
categories = ["command-line-utilities"]
|
2016-02-27 18:07:26 +02:00
|
|
|
license = "Unlicense/MIT"
|
2016-10-11 04:24:28 +02:00
|
|
|
exclude = ["HomebrewFormula"]
|
Switch from Docopt to Clap.
There were two important reasons for the switch:
1. Performance. Docopt does poorly when the argv becomes large, which is
a reasonable common use case for search tools. (e.g., use with xargs)
2. Better failure modes. Clap knows a lot more about how a particular
argv might be invalid, and can therefore provide much clearer error
messages.
While both were important, (1) made it urgent.
Note that since Clap requires at least Rust 1.11, this will in turn
increase the minimum Rust version supported by ripgrep from Rust 1.9 to
Rust 1.11. It is therefore a breaking change, so the soonest release of
ripgrep with Clap will have to be 0.3.
There is also at least one subtle breaking change in real usage.
Previous to this commit, this used to work:
rg -e -foo
Where this would cause ripgrep to search for the string `-foo`. Clap
currently has problems supporting this use case
(see: https://github.com/kbknapp/clap-rs/issues/742),
but it can be worked around by using this instead:
rg -e [-]foo
or even
rg [-]foo
and this still works:
rg -- -foo
This commit also adds Bash, Fish and PowerShell completion files to the
release, fixes a bug that prevented ripgrep from working on file
paths containing invalid UTF-8 and shows short descriptions in the
output of `-h` but longer descriptions in the output of `--help`.
Fixes #136, Fixes #189, Fixes #210, Fixes #230
2016-11-13 04:48:11 +02:00
|
|
|
build = "build.rs"
|
2016-02-27 18:07:26 +02:00
|
|
|
|
2016-08-26 03:44:37 +02:00
|
|
|
[[bin]]
|
|
|
|
bench = false
|
|
|
|
path = "src/main.rs"
|
2016-09-08 22:15:44 +02:00
|
|
|
name = "rg"
|
2016-08-26 03:44:37 +02:00
|
|
|
|
2016-09-10 04:58:30 +02:00
|
|
|
[[test]]
|
|
|
|
name = "integration"
|
|
|
|
path = "tests/tests.rs"
|
|
|
|
|
2016-02-27 18:07:26 +02:00
|
|
|
[dependencies]
|
2017-01-15 23:32:30 +02:00
|
|
|
atty = "0.2.2"
|
2016-09-23 04:59:25 +02:00
|
|
|
bytecount = "0.1.4"
|
2016-12-24 16:58:15 +02:00
|
|
|
clap = "2.19.0"
|
2016-12-30 23:24:09 +02:00
|
|
|
env_logger = { version = "0.3", default-features = false }
|
2017-01-14 06:46:21 +02:00
|
|
|
grep = { version = "0.1.5", path = "grep" }
|
|
|
|
ignore = { version = "0.1.7", path = "ignore" }
|
2016-09-05 23:36:41 +02:00
|
|
|
lazy_static = "0.2"
|
|
|
|
libc = "0.2"
|
2016-08-28 07:37:12 +02:00
|
|
|
log = "0.3"
|
2016-12-30 22:43:29 +02:00
|
|
|
memchr = "1"
|
2016-10-12 01:57:09 +02:00
|
|
|
memmap = "0.5"
|
2016-08-26 03:44:37 +02:00
|
|
|
num_cpus = "1"
|
2017-01-14 06:46:21 +02:00
|
|
|
regex = "0.2.1"
|
Don't search stdout redirected file.
When running ripgrep like this:
rg foo > output
we must be careful not to search `output` since ripgrep is actively writing
to it. Searching it can cause massive blowups where the file grows without
bound.
While this is conceptually easy to fix (check the inode of the redirection
and the inode of the file you're about to search), there are a few problems
with it.
First, inodes are a Unix thing, so we need a Windows specific solution to
this as well. To resolve this concern, I created a new crate, `same-file`,
which provides a cross platform abstraction.
Second, stat'ing every file is costly. This is not avoidable on Windows,
but on Unix, we can get the inode number directly from directory traversal.
However, this information wasn't exposed, but now it is (through both the
ignore and walkdir crates).
Fixes #286
2017-01-08 17:27:30 +02:00
|
|
|
same-file = "0.1.1"
|
2017-01-14 06:46:21 +02:00
|
|
|
termcolor = { version = "0.2.0", path = "termcolor" }
|
2016-08-26 03:44:37 +02:00
|
|
|
|
2016-09-05 23:36:41 +02:00
|
|
|
[target.'cfg(windows)'.dependencies]
|
Completely re-work colored output and tty handling.
This commit completely guts all of the color handling code and replaces
most of it with two new crates: wincolor and termcolor. wincolor
provides a simple API to coloring using the Windows console and
termcolor provides a platform independent coloring API tuned for
multithreaded command line programs. This required a lot more
flexibility than what the `term` crate provided, so it was dropped.
We instead switch to writing ANSI escape sequences directly and ignore
the TERMINFO database.
In addition to fixing several bugs, this commit also permits end users
to customize colors to a certain extent. For example, this command will
set the match color to magenta and the line number background to yellow:
rg --colors 'match:fg:magenta' --colors 'line:bg:yellow' foo
For tty handling, we've adopted a hack from `git` to do tty detection in
MSYS/mintty terminals. As a result, ripgrep should get both color
detection and piping correct on Windows regardless of which terminal you
use.
Finally, switch to line buffering. Performance doesn't seem to be
impacted and it's an otherwise more user friendly option.
Fixes #37, Fixes #51, Fixes #94, Fixes #117, Fixes #182, Fixes #231
2016-11-20 18:14:52 +02:00
|
|
|
kernel32-sys = "0.2.2"
|
|
|
|
winapi = "0.2.8"
|
2016-09-05 23:36:41 +02:00
|
|
|
|
Switch from Docopt to Clap.
There were two important reasons for the switch:
1. Performance. Docopt does poorly when the argv becomes large, which is
a reasonable common use case for search tools. (e.g., use with xargs)
2. Better failure modes. Clap knows a lot more about how a particular
argv might be invalid, and can therefore provide much clearer error
messages.
While both were important, (1) made it urgent.
Note that since Clap requires at least Rust 1.11, this will in turn
increase the minimum Rust version supported by ripgrep from Rust 1.9 to
Rust 1.11. It is therefore a breaking change, so the soonest release of
ripgrep with Clap will have to be 0.3.
There is also at least one subtle breaking change in real usage.
Previous to this commit, this used to work:
rg -e -foo
Where this would cause ripgrep to search for the string `-foo`. Clap
currently has problems supporting this use case
(see: https://github.com/kbknapp/clap-rs/issues/742),
but it can be worked around by using this instead:
rg -e [-]foo
or even
rg [-]foo
and this still works:
rg -- -foo
This commit also adds Bash, Fish and PowerShell completion files to the
release, fixes a bug that prevented ripgrep from working on file
paths containing invalid UTF-8 and shows short descriptions in the
output of `-h` but longer descriptions in the output of `--help`.
Fixes #136, Fixes #189, Fixes #210, Fixes #230
2016-11-13 04:48:11 +02:00
|
|
|
[build-dependencies]
|
|
|
|
clap = "2.18"
|
|
|
|
lazy_static = "0.2"
|
|
|
|
|
2016-08-27 07:01:06 +02:00
|
|
|
[features]
|
2016-11-06 04:44:33 +02:00
|
|
|
avx-accel = ["bytecount/avx-accel"]
|
2016-11-06 23:15:23 +02:00
|
|
|
simd-accel = ["bytecount/simd-accel", "regex/simd-accel"]
|
2016-08-27 07:01:06 +02:00
|
|
|
|
2016-02-27 18:07:26 +02:00
|
|
|
[profile.release]
|
|
|
|
debug = true
|