mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2024-12-12 19:18:24 +02:00
e8a30cb893
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
367 lines
16 KiB
TOML
367 lines
16 KiB
TOML
[root]
|
|
name = "ripgrep"
|
|
version = "0.2.9"
|
|
dependencies = [
|
|
"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)",
|
|
"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)",
|
|
"grep 0.1.4",
|
|
"ignore 0.1.5",
|
|
"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)",
|
|
"libc 0.2.17 (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)",
|
|
"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)",
|
|
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"termcolor 0.1.0",
|
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "aho-corasick"
|
|
version = "0.5.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "ansi_term"
|
|
version = "0.9.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "bitflags"
|
|
version = "0.7.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "bytecount"
|
|
version = "0.1.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"simd 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "clap"
|
|
version = "2.18.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"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)",
|
|
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"strsim 0.5.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-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)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "crossbeam"
|
|
version = "0.2.10"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "ctrlc"
|
|
version = "2.0.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"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)",
|
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "env_logger"
|
|
version = "0.3.5"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "fnv"
|
|
version = "1.0.5"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "fs2"
|
|
version = "0.3.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"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)",
|
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "globset"
|
|
version = "0.1.2"
|
|
dependencies = [
|
|
"aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"lazy_static 0.2.2 (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)",
|
|
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "grep"
|
|
version = "0.1.4"
|
|
dependencies = [
|
|
"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)",
|
|
"memmap 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "ignore"
|
|
version = "0.1.5"
|
|
dependencies = [
|
|
"crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"globset 0.1.2",
|
|
"lazy_static 0.2.2 (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)",
|
|
"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)",
|
|
"walkdir 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "kernel32-sys"
|
|
version = "0.2.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "lazy_static"
|
|
version = "0.2.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "libc"
|
|
version = "0.2.17"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "log"
|
|
version = "0.3.6"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "memchr"
|
|
version = "0.1.11"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "memmap"
|
|
version = "0.5.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"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)",
|
|
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "num_cpus"
|
|
version = "1.1.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "regex"
|
|
version = "0.1.80"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"simd 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "regex-syntax"
|
|
version = "0.3.9"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "simd"
|
|
version = "0.1.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "strsim"
|
|
version = "0.5.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "term_size"
|
|
version = "0.2.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"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)",
|
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "termcolor"
|
|
version = "0.1.0"
|
|
dependencies = [
|
|
"wincolor 0.1.0",
|
|
]
|
|
|
|
[[package]]
|
|
name = "thread-id"
|
|
version = "2.0.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"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)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "thread-id"
|
|
version = "3.0.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"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)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "thread_local"
|
|
version = "0.2.7"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "thread_local"
|
|
version = "0.3.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "unicode-segmentation"
|
|
version = "0.1.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "unicode-width"
|
|
version = "0.1.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "unreachable"
|
|
version = "0.1.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "utf8-ranges"
|
|
version = "0.1.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "vec_map"
|
|
version = "0.6.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "void"
|
|
version = "1.0.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "walkdir"
|
|
version = "1.0.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "winapi"
|
|
version = "0.2.8"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "winapi-build"
|
|
version = "0.1.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "wincolor"
|
|
version = "0.1.0"
|
|
dependencies = [
|
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[metadata]
|
|
"checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66"
|
|
"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 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 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 env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f"
|
|
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344"
|
|
"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 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 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 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 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 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 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 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.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-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 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 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 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"
|