2019-01-29 20:04:40 +02:00
|
|
|
# This file is automatically @generated by Cargo.
|
|
|
|
# It is not intended for manual editing.
|
2022-06-10 15:39:17 +02:00
|
|
|
version = 3
|
|
|
|
|
2019-04-03 19:07:26 +02:00
|
|
|
[[package]]
|
|
|
|
name = "aho-corasick"
|
2023-10-10 00:23:36 +02:00
|
|
|
version = "1.1.2"
|
2019-04-03 19:07:26 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-10 00:23:36 +02:00
|
|
|
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
|
2023-05-16 19:14:23 +02:00
|
|
|
dependencies = [
|
|
|
|
"memchr",
|
|
|
|
]
|
|
|
|
|
2023-10-12 18:16:42 +02:00
|
|
|
[[package]]
|
|
|
|
name = "anyhow"
|
|
|
|
version = "1.0.75"
|
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
|
|
|
|
|
2023-08-29 02:00:41 +02:00
|
|
|
[[package]]
|
|
|
|
name = "autocfg"
|
|
|
|
version = "1.1.0"
|
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
|
|
|
|
2019-04-06 04:28:43 +02:00
|
|
|
[[package]]
|
|
|
|
name = "bstr"
|
2023-10-10 00:23:36 +02:00
|
|
|
version = "1.7.0"
|
2019-04-06 04:28:43 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-10 00:23:36 +02:00
|
|
|
checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019"
|
2019-04-06 04:28:43 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"memchr",
|
2023-07-05 17:08:13 +02:00
|
|
|
"regex-automata",
|
2023-01-05 15:19:33 +02:00
|
|
|
"serde",
|
2019-04-06 04:28:43 +02:00
|
|
|
]
|
|
|
|
|
2018-04-29 15:29:52 +02:00
|
|
|
[[package]]
|
|
|
|
name = "cc"
|
2023-08-29 02:00:41 +02:00
|
|
|
version = "1.0.83"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-08-29 02:00:41 +02:00
|
|
|
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
|
2020-08-20 00:55:16 +02:00
|
|
|
dependencies = [
|
|
|
|
"jobserver",
|
2023-08-15 17:09:46 +02:00
|
|
|
"libc",
|
2020-08-20 00:55:16 +02:00
|
|
|
]
|
2018-04-29 15:29:52 +02:00
|
|
|
|
2020-11-02 16:04:39 +02:00
|
|
|
[[package]]
|
|
|
|
name = "cfg-if"
|
|
|
|
version = "1.0.0"
|
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "crossbeam-channel"
|
2023-05-16 19:14:23 +02:00
|
|
|
version = "0.5.8"
|
2020-11-02 16:04:39 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-05-16 19:14:23 +02:00
|
|
|
checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200"
|
2018-08-22 01:47:12 +02:00
|
|
|
dependencies = [
|
2022-03-21 14:37:18 +02:00
|
|
|
"cfg-if",
|
2020-08-20 00:55:16 +02:00
|
|
|
"crossbeam-utils",
|
2018-08-22 01:47:12 +02:00
|
|
|
]
|
|
|
|
|
2023-08-21 19:58:27 +02:00
|
|
|
[[package]]
|
|
|
|
name = "crossbeam-deque"
|
|
|
|
version = "0.8.3"
|
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
|
|
|
|
dependencies = [
|
|
|
|
"cfg-if",
|
|
|
|
"crossbeam-epoch",
|
|
|
|
"crossbeam-utils",
|
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "crossbeam-epoch"
|
|
|
|
version = "0.9.15"
|
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7"
|
|
|
|
dependencies = [
|
|
|
|
"autocfg",
|
|
|
|
"cfg-if",
|
|
|
|
"crossbeam-utils",
|
|
|
|
"memoffset",
|
|
|
|
"scopeguard",
|
|
|
|
]
|
|
|
|
|
2018-08-22 01:47:12 +02:00
|
|
|
[[package]]
|
|
|
|
name = "crossbeam-utils"
|
2023-06-18 19:07:48 +02:00
|
|
|
version = "0.8.16"
|
2016-11-06 03:44:15 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-06-18 19:07:48 +02:00
|
|
|
checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
|
2018-12-15 15:37:52 +02:00
|
|
|
dependencies = [
|
2022-03-21 14:37:18 +02:00
|
|
|
"cfg-if",
|
2018-12-15 15:37:52 +02:00
|
|
|
]
|
2016-11-06 03:44:15 +02:00
|
|
|
|
Add support for additional text encodings.
This includes, but is not limited to, UTF-16, latin-1, GBK, EUC-JP and
Shift_JIS. (Courtesy of the `encoding_rs` crate.)
Specifically, this feature enables ripgrep to search files that are
encoded in an encoding other than UTF-8. The list of available encodings
is tied directly to what the `encoding_rs` crate supports, which is in
turn tied to the Encoding Standard. The full list of available encodings
can be found here: https://encoding.spec.whatwg.org/#concept-encoding-get
This pull request also introduces the notion that text encodings can be
automatically detected on a best effort basis. Currently, the only
support for this is checking for a UTF-16 bom. In all other cases, a
text encoding of `auto` (the default) implies a UTF-8 or ASCII
compatible source encoding. When a text encoding is otherwise specified,
it is unconditionally used for all files searched.
Since ripgrep's regex engine is fundamentally built on top of UTF-8,
this feature works by transcoding the files to be searched from their
source encoding to UTF-8. This transcoding only happens when:
1. `auto` is specified and a non-UTF-8 encoding is detected.
2. A specific encoding is given by end users (including UTF-8).
When transcoding occurs, errors are handled by automatically inserting
the Unicode replacement character. In this case, ripgrep's output is
guaranteed to be valid UTF-8 (excluding non-UTF-8 file paths, if they
are printed).
In all other cases, the source text is searched directly, which implies
an assumption that it is at least ASCII compatible, but where UTF-8 is
most useful. In this scenario, encoding errors are not detected. In this
case, ripgrep's output will match the input exactly, byte-for-byte.
This design may not be optimal in all cases, but it has some advantages:
1. In the happy path ("UTF-8 everywhere") remains happy. I have not been
able to witness any performance regressions.
2. In the non-UTF-8 path, implementation complexity is kept relatively
low. The cost here is transcoding itself. A potentially superior
implementation might build decoding of any encoding into the regex
engine itself. In particular, the fundamental problem with
transcoding everything first is that literal optimizations are nearly
negated.
Future work should entail improving the user experience. For example, we
might want to auto-detect more text encodings. A more elaborate UX
experience might permit end users to specify multiple text encodings,
although this seems hard to pull off in an ergonomic way.
Fixes #1
2017-03-09 03:22:48 +02:00
|
|
|
[[package]]
|
|
|
|
name = "encoding_rs"
|
2023-08-29 02:00:41 +02:00
|
|
|
version = "0.8.33"
|
Add support for additional text encodings.
This includes, but is not limited to, UTF-16, latin-1, GBK, EUC-JP and
Shift_JIS. (Courtesy of the `encoding_rs` crate.)
Specifically, this feature enables ripgrep to search files that are
encoded in an encoding other than UTF-8. The list of available encodings
is tied directly to what the `encoding_rs` crate supports, which is in
turn tied to the Encoding Standard. The full list of available encodings
can be found here: https://encoding.spec.whatwg.org/#concept-encoding-get
This pull request also introduces the notion that text encodings can be
automatically detected on a best effort basis. Currently, the only
support for this is checking for a UTF-16 bom. In all other cases, a
text encoding of `auto` (the default) implies a UTF-8 or ASCII
compatible source encoding. When a text encoding is otherwise specified,
it is unconditionally used for all files searched.
Since ripgrep's regex engine is fundamentally built on top of UTF-8,
this feature works by transcoding the files to be searched from their
source encoding to UTF-8. This transcoding only happens when:
1. `auto` is specified and a non-UTF-8 encoding is detected.
2. A specific encoding is given by end users (including UTF-8).
When transcoding occurs, errors are handled by automatically inserting
the Unicode replacement character. In this case, ripgrep's output is
guaranteed to be valid UTF-8 (excluding non-UTF-8 file paths, if they
are printed).
In all other cases, the source text is searched directly, which implies
an assumption that it is at least ASCII compatible, but where UTF-8 is
most useful. In this scenario, encoding errors are not detected. In this
case, ripgrep's output will match the input exactly, byte-for-byte.
This design may not be optimal in all cases, but it has some advantages:
1. In the happy path ("UTF-8 everywhere") remains happy. I have not been
able to witness any performance regressions.
2. In the non-UTF-8 path, implementation complexity is kept relatively
low. The cost here is transcoding itself. A potentially superior
implementation might build decoding of any encoding into the regex
engine itself. In particular, the fundamental problem with
transcoding everything first is that literal optimizations are nearly
negated.
Future work should entail improving the user experience. For example, we
might want to auto-detect more text encodings. A more elaborate UX
experience might permit end users to specify multiple text encodings,
although this seems hard to pull off in an ergonomic way.
Fixes #1
2017-03-09 03:22:48 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-08-29 02:00:41 +02:00
|
|
|
checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1"
|
Add support for additional text encodings.
This includes, but is not limited to, UTF-16, latin-1, GBK, EUC-JP and
Shift_JIS. (Courtesy of the `encoding_rs` crate.)
Specifically, this feature enables ripgrep to search files that are
encoded in an encoding other than UTF-8. The list of available encodings
is tied directly to what the `encoding_rs` crate supports, which is in
turn tied to the Encoding Standard. The full list of available encodings
can be found here: https://encoding.spec.whatwg.org/#concept-encoding-get
This pull request also introduces the notion that text encodings can be
automatically detected on a best effort basis. Currently, the only
support for this is checking for a UTF-16 bom. In all other cases, a
text encoding of `auto` (the default) implies a UTF-8 or ASCII
compatible source encoding. When a text encoding is otherwise specified,
it is unconditionally used for all files searched.
Since ripgrep's regex engine is fundamentally built on top of UTF-8,
this feature works by transcoding the files to be searched from their
source encoding to UTF-8. This transcoding only happens when:
1. `auto` is specified and a non-UTF-8 encoding is detected.
2. A specific encoding is given by end users (including UTF-8).
When transcoding occurs, errors are handled by automatically inserting
the Unicode replacement character. In this case, ripgrep's output is
guaranteed to be valid UTF-8 (excluding non-UTF-8 file paths, if they
are printed).
In all other cases, the source text is searched directly, which implies
an assumption that it is at least ASCII compatible, but where UTF-8 is
most useful. In this scenario, encoding errors are not detected. In this
case, ripgrep's output will match the input exactly, byte-for-byte.
This design may not be optimal in all cases, but it has some advantages:
1. In the happy path ("UTF-8 everywhere") remains happy. I have not been
able to witness any performance regressions.
2. In the non-UTF-8 path, implementation complexity is kept relatively
low. The cost here is transcoding itself. A potentially superior
implementation might build decoding of any encoding into the regex
engine itself. In particular, the fundamental problem with
transcoding everything first is that literal optimizations are nearly
negated.
Future work should entail improving the user experience. For example, we
might want to auto-detect more text encodings. A more elaborate UX
experience might permit end users to specify multiple text encodings,
although this seems hard to pull off in an ergonomic way.
Fixes #1
2017-03-09 03:22:48 +02:00
|
|
|
dependencies = [
|
2022-03-21 14:37:18 +02:00
|
|
|
"cfg-if",
|
2023-08-29 02:00:41 +02:00
|
|
|
"packed_simd",
|
Add support for additional text encodings.
This includes, but is not limited to, UTF-16, latin-1, GBK, EUC-JP and
Shift_JIS. (Courtesy of the `encoding_rs` crate.)
Specifically, this feature enables ripgrep to search files that are
encoded in an encoding other than UTF-8. The list of available encodings
is tied directly to what the `encoding_rs` crate supports, which is in
turn tied to the Encoding Standard. The full list of available encodings
can be found here: https://encoding.spec.whatwg.org/#concept-encoding-get
This pull request also introduces the notion that text encodings can be
automatically detected on a best effort basis. Currently, the only
support for this is checking for a UTF-16 bom. In all other cases, a
text encoding of `auto` (the default) implies a UTF-8 or ASCII
compatible source encoding. When a text encoding is otherwise specified,
it is unconditionally used for all files searched.
Since ripgrep's regex engine is fundamentally built on top of UTF-8,
this feature works by transcoding the files to be searched from their
source encoding to UTF-8. This transcoding only happens when:
1. `auto` is specified and a non-UTF-8 encoding is detected.
2. A specific encoding is given by end users (including UTF-8).
When transcoding occurs, errors are handled by automatically inserting
the Unicode replacement character. In this case, ripgrep's output is
guaranteed to be valid UTF-8 (excluding non-UTF-8 file paths, if they
are printed).
In all other cases, the source text is searched directly, which implies
an assumption that it is at least ASCII compatible, but where UTF-8 is
most useful. In this scenario, encoding errors are not detected. In this
case, ripgrep's output will match the input exactly, byte-for-byte.
This design may not be optimal in all cases, but it has some advantages:
1. In the happy path ("UTF-8 everywhere") remains happy. I have not been
able to witness any performance regressions.
2. In the non-UTF-8 path, implementation complexity is kept relatively
low. The cost here is transcoding itself. A potentially superior
implementation might build decoding of any encoding into the regex
engine itself. In particular, the fundamental problem with
transcoding everything first is that literal optimizations are nearly
negated.
Future work should entail improving the user experience. For example, we
might want to auto-detect more text encodings. A more elaborate UX
experience might permit end users to specify multiple text encodings,
although this seems hard to pull off in an ergonomic way.
Fixes #1
2017-03-09 03:22:48 +02:00
|
|
|
]
|
|
|
|
|
2018-07-22 02:36:32 +02:00
|
|
|
[[package]]
|
|
|
|
name = "encoding_rs_io"
|
2020-03-15 14:32:33 +02:00
|
|
|
version = "0.1.7"
|
2018-07-22 02:36:32 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2020-08-20 00:55:16 +02:00
|
|
|
checksum = "1cc3c5651fb62ab8aa3103998dade57efdd028544bd300516baa31840c252a83"
|
2018-07-22 02:36:32 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"encoding_rs",
|
2018-07-22 02:36:32 +02:00
|
|
|
]
|
|
|
|
|
2017-12-30 22:46:55 +02:00
|
|
|
[[package]]
|
|
|
|
name = "glob"
|
2023-05-16 19:14:23 +02:00
|
|
|
version = "0.3.1"
|
2017-12-30 22:46:55 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-05-16 19:14:23 +02:00
|
|
|
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
2017-12-30 22:46:55 +02:00
|
|
|
|
2016-10-01 01:42:41 +02:00
|
|
|
[[package]]
|
|
|
|
name = "globset"
|
2023-08-05 15:34:36 +02:00
|
|
|
version = "0.4.13"
|
2016-10-01 01:42:41 +02:00
|
|
|
dependencies = [
|
2023-06-12 03:25:23 +02:00
|
|
|
"aho-corasick",
|
2020-08-20 00:55:16 +02:00
|
|
|
"bstr",
|
|
|
|
"glob",
|
|
|
|
"log",
|
2023-09-26 21:01:20 +02:00
|
|
|
"regex-automata",
|
|
|
|
"regex-syntax",
|
2020-08-20 00:55:16 +02:00
|
|
|
"serde",
|
|
|
|
"serde_json",
|
2016-10-01 01:42:41 +02:00
|
|
|
]
|
|
|
|
|
2016-09-12 01:06:05 +02:00
|
|
|
[[package]]
|
|
|
|
name = "grep"
|
2023-05-16 19:12:45 +02:00
|
|
|
version = "0.2.12"
|
2016-09-12 01:06:05 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"grep-cli",
|
|
|
|
"grep-matcher",
|
|
|
|
"grep-pcre2",
|
|
|
|
"grep-printer",
|
|
|
|
"grep-regex",
|
|
|
|
"grep-searcher",
|
|
|
|
"termcolor",
|
|
|
|
"walkdir",
|
2016-10-12 01:57:09 +02:00
|
|
|
]
|
|
|
|
|
2018-08-30 02:53:52 +02:00
|
|
|
[[package]]
|
|
|
|
name = "grep-cli"
|
2023-07-18 19:25:23 +02:00
|
|
|
version = "0.1.9"
|
2018-08-30 02:53:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"bstr",
|
|
|
|
"globset",
|
2023-09-21 19:13:46 +02:00
|
|
|
"libc",
|
2020-08-20 00:55:16 +02:00
|
|
|
"log",
|
|
|
|
"termcolor",
|
|
|
|
"winapi-util",
|
2018-08-30 02:53:52 +02:00
|
|
|
]
|
|
|
|
|
2018-04-29 15:29:52 +02:00
|
|
|
[[package]]
|
|
|
|
name = "grep-matcher"
|
2023-01-05 16:00:33 +02:00
|
|
|
version = "0.1.6"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"memchr",
|
|
|
|
"regex",
|
2018-04-29 15:29:52 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "grep-pcre2"
|
2023-01-05 16:05:59 +02:00
|
|
|
version = "0.1.6"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"grep-matcher",
|
2023-06-20 02:47:07 +02:00
|
|
|
"log",
|
2020-08-20 00:55:16 +02:00
|
|
|
"pcre2",
|
2018-04-29 15:29:52 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "grep-printer"
|
2023-01-05 16:11:16 +02:00
|
|
|
version = "0.1.7"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"bstr",
|
|
|
|
"grep-matcher",
|
|
|
|
"grep-regex",
|
|
|
|
"grep-searcher",
|
2023-09-22 20:57:44 +02:00
|
|
|
"log",
|
2020-08-20 00:55:16 +02:00
|
|
|
"serde",
|
|
|
|
"serde_json",
|
|
|
|
"termcolor",
|
2018-04-29 15:29:52 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "grep-regex"
|
2023-01-05 16:02:55 +02:00
|
|
|
version = "0.1.11"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"bstr",
|
|
|
|
"grep-matcher",
|
|
|
|
"log",
|
2023-07-05 17:08:13 +02:00
|
|
|
"regex-automata",
|
2023-06-12 03:25:23 +02:00
|
|
|
"regex-syntax",
|
2018-04-29 15:29:52 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "grep-searcher"
|
2023-01-05 16:07:09 +02:00
|
|
|
version = "0.1.11"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"bstr",
|
|
|
|
"encoding_rs",
|
|
|
|
"encoding_rs_io",
|
|
|
|
"grep-matcher",
|
|
|
|
"grep-regex",
|
|
|
|
"log",
|
deps: drop bytecount in favor of memchr_iter(..).count()
As of the memchr 2.6 release, its Iterator::count method is specialized
to only count the number of occurrences instead of finding the offset of
each occurrence. This replaces ripgrep's use of the bytecount crate.
While micro-benchmarks suggest that memchr's method has better
throughput than bytecount, it turned out to be an illusion. Namely, on a
~13GB haystack prior to this change:
$ time rg-bytecount 'You killed my friend, my best friend, my lifelong friend!' OpenSubtitles2018.raw.en --line-number
441450441:- You killed my friend, my best friend, my lifelong friend!
real 1.473
user 1.186
sys 0.286
maxmem 12512 MB
faults 0
And then after:
$ time rg 'You killed my friend, my best friend, my lifelong friend!' OpenSubtitles2018.raw.en --line-number
441450441:- You killed my friend, my best friend, my lifelong friend!
real 1.532
user 1.280
sys 0.250
maxmem 12512 MB
faults 0
But perf is just about in the same ballpark. That's good enough for me
at the moment in order to drop the extra dependency.
I did this because the marginal cost of adding the Iterator::count()
specialization to memchr was extremely small.
2023-09-02 18:25:34 +02:00
|
|
|
"memchr",
|
2021-01-18 01:49:51 +02:00
|
|
|
"memmap2",
|
2020-08-20 00:55:16 +02:00
|
|
|
"regex",
|
2020-01-10 03:38:00 +02:00
|
|
|
]
|
|
|
|
|
2016-10-12 01:57:09 +02:00
|
|
|
[[package]]
|
|
|
|
name = "ignore"
|
2023-01-15 15:21:02 +02:00
|
|
|
version = "0.4.20"
|
2016-10-12 01:57:09 +02:00
|
|
|
dependencies = [
|
2023-09-28 20:17:30 +02:00
|
|
|
"bstr",
|
2020-08-20 00:55:16 +02:00
|
|
|
"crossbeam-channel",
|
2023-08-21 19:58:27 +02:00
|
|
|
"crossbeam-deque",
|
2020-08-20 00:55:16 +02:00
|
|
|
"globset",
|
|
|
|
"log",
|
|
|
|
"memchr",
|
2023-09-28 22:01:59 +02:00
|
|
|
"regex-automata",
|
2020-08-20 00:55:16 +02:00
|
|
|
"same-file",
|
|
|
|
"walkdir",
|
|
|
|
"winapi-util",
|
2016-09-12 01:06:05 +02:00
|
|
|
]
|
|
|
|
|
2018-04-29 15:29:52 +02:00
|
|
|
[[package]]
|
|
|
|
name = "itoa"
|
2023-08-15 17:09:46 +02:00
|
|
|
version = "1.0.9"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-08-15 17:09:46 +02:00
|
|
|
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
|
2018-04-29 15:29:52 +02:00
|
|
|
|
2019-04-24 23:21:38 +02:00
|
|
|
[[package]]
|
|
|
|
name = "jemalloc-sys"
|
2023-08-15 17:09:46 +02:00
|
|
|
version = "0.5.4+5.3.0-patched"
|
2019-04-24 23:21:38 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-08-15 17:09:46 +02:00
|
|
|
checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2"
|
2019-04-24 23:21:38 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"cc",
|
|
|
|
"libc",
|
2019-04-24 23:21:38 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "jemallocator"
|
2023-08-15 17:09:46 +02:00
|
|
|
version = "0.5.4"
|
2019-04-24 23:21:38 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-08-15 17:09:46 +02:00
|
|
|
checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc"
|
2019-04-24 23:21:38 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"jemalloc-sys",
|
|
|
|
"libc",
|
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "jobserver"
|
2023-10-11 22:23:43 +02:00
|
|
|
version = "0.1.27"
|
2020-08-20 00:55:16 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-11 22:23:43 +02:00
|
|
|
checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d"
|
2020-08-20 00:55:16 +02:00
|
|
|
dependencies = [
|
|
|
|
"libc",
|
2019-04-24 23:21:38 +02:00
|
|
|
]
|
|
|
|
|
cli: replace clap with lexopt and supporting code
ripgrep began it's life with docopt for argument parsing. Then it moved
to Clap and stayed there for a number of years. Clap has served ripgrep
well, and it probably could continue to serve ripgrep well, but I ended
up deciding to move off of it.
Why?
The first time I had the thought of moving off of Clap was during the
2->3->4 transition. I thought the 3.x and 4.x releases were great, but
for me, it ended up moving a little too quickly. Since the release of
4.x was telegraphed around when 3.x came out, I decided to just hold off
and wait to migrate to 4.x instead of doing a 3.x migration followed
shortly by another 4.x migration. Of course, I just never ended up doing
the migration at all. I never got around to it and there just wasn't a
compelling reason for me to upgrade. While I never investigated it, I
saw an upgrade as a non-trivial amount of work in part because I didn't
encapsulate the usage of Clap enough.
The above is just what got me started thinking about it. It wasn't
enough to get me to move off of it on its own. What ended up pushing me
over the edge was a combination of factors:
* As mentioned above, I didn't want to run on the migration treadmill.
This has proven to not be much of an issue, but at the time of the
2->3->4 releases, I didn't know how long Clap 4.x would be out before a
5.x would come out.
* The release of lexopt[1] caught my eye. IMO, that crate demonstrates
exactly how something new can arrive on the scene and just thoroughly
solve a problem minimalistically. It has the docs, the reasoning, the
simple API, the tests and good judgment. It gets all the weird corner
cases right that Clap also gets right (and is part of why I was
originally attracted to Clap).
* I have an overall desire to reduce the size of my dependency tree. In
part because a smaller dependency tree tends to correlate with better
compile times, but also in part because it reduces my reliance and trust
on others. It lets me be the "master" of ripgrep's destiny by reducing
the amount of behavior that is the result of someone else's decision
(whether good or bad).
* I perceived that Clap solves a more general problem than what I
actually need solved. Despite the vast number of flags that ripgrep has,
its requirements are actually pretty simple. We just need simple
switches and flags that support one value. No multi-value flags. No
sub-commands. And probably a lot of other functionality that Clap has
that makes it so flexible for so many different use cases. (I'm being
hand wavy on the last point.)
With all that said, perhaps most importantly, the future of ripgrep
possibly demands a more flexible CLI argument parser. In today's world,
I would really like, for example, flags like `--type` and `--type-not`
to be able to accumulate their repeated values into a single sequence
while respecting the order they appear on the CLI. For example, prior
to this migration, `rg regex-automata -Tlock -ttoml` would not return
results in `Cargo.lock` in this repository because the `-Tlock` always
took priority even though `-ttoml` appeared after it. But with this
migration, `-ttoml` now correctly overrides `-Tlock`. We would like to
do similar things for `-g/--glob` and `--iglob` and potentially even
now introduce a `-G/--glob-not` flag instead of requiring users to use
`!` to negate a glob. (Which I had done originally to work-around this
problem.) And some day, I'd like to add some kind of boolean matching to
ripgrep perhaps similar to how `git grep` does it. (Although I haven't
thought too carefully on a design yet.) In order to do that, I perceive
it would be difficult to implement correctly in Clap.
I believe that this last point is possible to implement correctly in
Clap 2.x, although it is awkward to do so. I have not looked closely
enough at the Clap 4.x API to know whether it's still possible there. In
any case, these were enough reasons to move off of Clap and own more of
the argument parsing process myself.
This did require a few things:
* I had to write my own logic for how arguments are combined into one
single state object. Of course, I wanted this. This was part of the
upside. But it's still code I didn't have to write for Clap.
* I had to write my own shell completion generator.
* I had to write my own `-h/--help` output generator.
* I also had to write my own man page generator. Well, I had to do this
with Clap 2.x too, although my understanding is that Clap 4.x supports
this. With that said, without having tried it, my guess is that I
probably wouldn't have liked the output it generated because I
ultimately had to write most of the roff by hand myself to get the man
page I wanted. (This also had the benefit of dropping the build
dependency on asciidoc/asciidoctor.)
While this is definitely a fair bit of extra work, it overall only cost
me a couple days. IMO, that's a good trade off given that this code is
unlikely to change again in any substantial way. And it should also
allow for more flexible semantics going forward.
Fixes #884, Fixes #1648, Fixes #1701, Fixes #1814, Fixes #1966
[1]: https://docs.rs/lexopt/0.3.0/lexopt/index.html
2023-10-17 00:05:39 +02:00
|
|
|
[[package]]
|
|
|
|
name = "lexopt"
|
|
|
|
version = "0.3.0"
|
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
checksum = "baff4b617f7df3d896f97fe922b64817f6cd9a756bb81d40f8883f2f66dcb401"
|
|
|
|
|
2016-09-12 01:06:05 +02:00
|
|
|
[[package]]
|
|
|
|
name = "libc"
|
2023-10-10 00:23:43 +02:00
|
|
|
version = "0.2.149"
|
2016-09-12 01:06:05 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-10 00:23:43 +02:00
|
|
|
checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
|
2016-09-12 01:06:05 +02:00
|
|
|
|
|
|
|
[[package]]
|
2020-11-02 16:04:39 +02:00
|
|
|
name = "libm"
|
2023-10-10 00:23:43 +02:00
|
|
|
version = "0.2.8"
|
2017-10-22 00:45:39 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-10 00:23:43 +02:00
|
|
|
checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
|
2017-10-22 00:45:39 +02:00
|
|
|
|
2020-03-15 14:32:33 +02:00
|
|
|
[[package]]
|
2020-11-02 16:04:39 +02:00
|
|
|
name = "log"
|
2023-08-15 17:09:46 +02:00
|
|
|
version = "0.4.20"
|
2020-03-15 14:32:33 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-08-15 17:09:46 +02:00
|
|
|
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
|
2020-03-15 14:32:33 +02:00
|
|
|
|
2017-10-22 00:45:39 +02:00
|
|
|
[[package]]
|
|
|
|
name = "memchr"
|
2023-10-10 00:23:36 +02:00
|
|
|
version = "2.6.4"
|
2016-12-30 22:43:29 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-10 00:23:36 +02:00
|
|
|
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
|
2016-12-30 22:43:29 +02:00
|
|
|
|
2016-09-12 01:06:05 +02:00
|
|
|
[[package]]
|
2021-01-18 01:49:51 +02:00
|
|
|
name = "memmap2"
|
2023-09-28 18:58:11 +02:00
|
|
|
version = "0.8.0"
|
2017-11-13 20:55:41 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-09-28 18:58:11 +02:00
|
|
|
checksum = "43a5a03cefb0d953ec0be133036f14e109412fa594edc2f77227249db66cc3ed"
|
2016-09-12 01:06:05 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"libc",
|
2016-09-12 01:06:05 +02:00
|
|
|
]
|
|
|
|
|
2023-08-21 19:58:27 +02:00
|
|
|
[[package]]
|
|
|
|
name = "memoffset"
|
|
|
|
version = "0.9.0"
|
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
|
|
|
|
dependencies = [
|
|
|
|
"autocfg",
|
|
|
|
]
|
|
|
|
|
2023-08-29 02:00:41 +02:00
|
|
|
[[package]]
|
|
|
|
name = "num-traits"
|
2023-10-10 00:23:43 +02:00
|
|
|
version = "0.2.17"
|
2023-08-29 02:00:41 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-10 00:23:43 +02:00
|
|
|
checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
|
2023-08-29 02:00:41 +02:00
|
|
|
dependencies = [
|
|
|
|
"autocfg",
|
|
|
|
"libm",
|
|
|
|
]
|
|
|
|
|
2019-02-08 00:05:14 +02:00
|
|
|
[[package]]
|
2023-08-29 02:00:41 +02:00
|
|
|
name = "packed_simd"
|
|
|
|
version = "0.3.9"
|
2019-02-08 00:05:14 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-08-29 02:00:41 +02:00
|
|
|
checksum = "1f9f08af0c877571712e2e3e686ad79efad9657dbf0f7c3c8ba943ff6c38932d"
|
2019-02-08 00:05:14 +02:00
|
|
|
dependencies = [
|
2022-03-21 14:37:18 +02:00
|
|
|
"cfg-if",
|
2023-08-29 02:00:41 +02:00
|
|
|
"num-traits",
|
2019-02-08 00:05:14 +02:00
|
|
|
]
|
|
|
|
|
2018-04-29 15:29:52 +02:00
|
|
|
[[package]]
|
|
|
|
name = "pcre2"
|
2023-09-28 22:01:59 +02:00
|
|
|
version = "0.2.5"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-09-28 22:01:59 +02:00
|
|
|
checksum = "9deb1d02d6a373ee392128ba86087352a986359f32a106e2e3b08cc90cc659c9"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"libc",
|
|
|
|
"log",
|
|
|
|
"pcre2-sys",
|
2018-04-29 15:29:52 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "pcre2-sys"
|
2023-06-18 19:07:48 +02:00
|
|
|
version = "0.2.6"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-06-18 19:07:48 +02:00
|
|
|
checksum = "ae234f441970dbd52d4e29bee70f3b56ca83040081cb2b55b7df772b16e0b06e"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"cc",
|
|
|
|
"libc",
|
|
|
|
"pkg-config",
|
2018-04-29 15:29:52 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "pkg-config"
|
2023-05-16 19:14:23 +02:00
|
|
|
version = "0.3.27"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-05-16 19:14:23 +02:00
|
|
|
checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
|
2018-04-29 15:29:52 +02:00
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "proc-macro2"
|
2023-10-10 00:23:43 +02:00
|
|
|
version = "1.0.69"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-10 00:23:43 +02:00
|
|
|
checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2022-12-20 16:23:29 +02:00
|
|
|
"unicode-ident",
|
2018-04-29 15:29:52 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "quote"
|
2023-08-29 02:00:41 +02:00
|
|
|
version = "1.0.33"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-08-29 02:00:41 +02:00
|
|
|
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"proc-macro2",
|
2018-04-29 15:29:52 +02:00
|
|
|
]
|
|
|
|
|
2016-09-12 01:06:05 +02:00
|
|
|
[[package]]
|
|
|
|
name = "regex"
|
2023-10-17 00:12:59 +02:00
|
|
|
version = "1.10.2"
|
2023-10-10 02:14:34 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-17 00:12:59 +02:00
|
|
|
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
|
2016-09-12 01:06:05 +02:00
|
|
|
dependencies = [
|
2023-06-12 03:25:23 +02:00
|
|
|
"aho-corasick",
|
2020-08-20 00:55:16 +02:00
|
|
|
"memchr",
|
2023-07-05 17:08:13 +02:00
|
|
|
"regex-automata",
|
2023-06-12 03:25:23 +02:00
|
|
|
"regex-syntax",
|
2016-09-12 01:06:05 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
2023-06-12 03:25:23 +02:00
|
|
|
name = "regex-automata"
|
2023-10-17 00:12:59 +02:00
|
|
|
version = "0.4.3"
|
2023-10-10 02:14:34 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-17 00:12:59 +02:00
|
|
|
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
|
2023-06-12 03:25:23 +02:00
|
|
|
dependencies = [
|
|
|
|
"aho-corasick",
|
|
|
|
"memchr",
|
|
|
|
"regex-syntax",
|
|
|
|
]
|
2023-05-16 19:14:23 +02:00
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "regex-syntax"
|
2023-10-14 17:12:27 +02:00
|
|
|
version = "0.8.2"
|
2023-10-10 02:14:34 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-14 17:12:27 +02:00
|
|
|
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
2018-03-10 21:02:06 +02:00
|
|
|
|
2017-10-29 00:32:43 +02:00
|
|
|
[[package]]
|
|
|
|
name = "ripgrep"
|
2021-06-12 14:12:24 +02:00
|
|
|
version = "13.0.0"
|
2017-10-29 00:32:43 +02:00
|
|
|
dependencies = [
|
2023-10-12 18:16:42 +02:00
|
|
|
"anyhow",
|
2020-08-20 00:55:16 +02:00
|
|
|
"bstr",
|
|
|
|
"grep",
|
|
|
|
"ignore",
|
|
|
|
"jemallocator",
|
cli: replace clap with lexopt and supporting code
ripgrep began it's life with docopt for argument parsing. Then it moved
to Clap and stayed there for a number of years. Clap has served ripgrep
well, and it probably could continue to serve ripgrep well, but I ended
up deciding to move off of it.
Why?
The first time I had the thought of moving off of Clap was during the
2->3->4 transition. I thought the 3.x and 4.x releases were great, but
for me, it ended up moving a little too quickly. Since the release of
4.x was telegraphed around when 3.x came out, I decided to just hold off
and wait to migrate to 4.x instead of doing a 3.x migration followed
shortly by another 4.x migration. Of course, I just never ended up doing
the migration at all. I never got around to it and there just wasn't a
compelling reason for me to upgrade. While I never investigated it, I
saw an upgrade as a non-trivial amount of work in part because I didn't
encapsulate the usage of Clap enough.
The above is just what got me started thinking about it. It wasn't
enough to get me to move off of it on its own. What ended up pushing me
over the edge was a combination of factors:
* As mentioned above, I didn't want to run on the migration treadmill.
This has proven to not be much of an issue, but at the time of the
2->3->4 releases, I didn't know how long Clap 4.x would be out before a
5.x would come out.
* The release of lexopt[1] caught my eye. IMO, that crate demonstrates
exactly how something new can arrive on the scene and just thoroughly
solve a problem minimalistically. It has the docs, the reasoning, the
simple API, the tests and good judgment. It gets all the weird corner
cases right that Clap also gets right (and is part of why I was
originally attracted to Clap).
* I have an overall desire to reduce the size of my dependency tree. In
part because a smaller dependency tree tends to correlate with better
compile times, but also in part because it reduces my reliance and trust
on others. It lets me be the "master" of ripgrep's destiny by reducing
the amount of behavior that is the result of someone else's decision
(whether good or bad).
* I perceived that Clap solves a more general problem than what I
actually need solved. Despite the vast number of flags that ripgrep has,
its requirements are actually pretty simple. We just need simple
switches and flags that support one value. No multi-value flags. No
sub-commands. And probably a lot of other functionality that Clap has
that makes it so flexible for so many different use cases. (I'm being
hand wavy on the last point.)
With all that said, perhaps most importantly, the future of ripgrep
possibly demands a more flexible CLI argument parser. In today's world,
I would really like, for example, flags like `--type` and `--type-not`
to be able to accumulate their repeated values into a single sequence
while respecting the order they appear on the CLI. For example, prior
to this migration, `rg regex-automata -Tlock -ttoml` would not return
results in `Cargo.lock` in this repository because the `-Tlock` always
took priority even though `-ttoml` appeared after it. But with this
migration, `-ttoml` now correctly overrides `-Tlock`. We would like to
do similar things for `-g/--glob` and `--iglob` and potentially even
now introduce a `-G/--glob-not` flag instead of requiring users to use
`!` to negate a glob. (Which I had done originally to work-around this
problem.) And some day, I'd like to add some kind of boolean matching to
ripgrep perhaps similar to how `git grep` does it. (Although I haven't
thought too carefully on a design yet.) In order to do that, I perceive
it would be difficult to implement correctly in Clap.
I believe that this last point is possible to implement correctly in
Clap 2.x, although it is awkward to do so. I have not looked closely
enough at the Clap 4.x API to know whether it's still possible there. In
any case, these were enough reasons to move off of Clap and own more of
the argument parsing process myself.
This did require a few things:
* I had to write my own logic for how arguments are combined into one
single state object. Of course, I wanted this. This was part of the
upside. But it's still code I didn't have to write for Clap.
* I had to write my own shell completion generator.
* I had to write my own `-h/--help` output generator.
* I also had to write my own man page generator. Well, I had to do this
with Clap 2.x too, although my understanding is that Clap 4.x supports
this. With that said, without having tried it, my guess is that I
probably wouldn't have liked the output it generated because I
ultimately had to write most of the roff by hand myself to get the man
page I wanted. (This also had the benefit of dropping the build
dependency on asciidoc/asciidoctor.)
While this is definitely a fair bit of extra work, it overall only cost
me a couple days. IMO, that's a good trade off given that this code is
unlikely to change again in any substantial way. And it should also
allow for more flexible semantics going forward.
Fixes #884, Fixes #1648, Fixes #1701, Fixes #1814, Fixes #1966
[1]: https://docs.rs/lexopt/0.3.0/lexopt/index.html
2023-10-17 00:05:39 +02:00
|
|
|
"lexopt",
|
2020-08-20 00:55:16 +02:00
|
|
|
"log",
|
|
|
|
"serde",
|
|
|
|
"serde_derive",
|
|
|
|
"serde_json",
|
|
|
|
"termcolor",
|
cli: replace clap with lexopt and supporting code
ripgrep began it's life with docopt for argument parsing. Then it moved
to Clap and stayed there for a number of years. Clap has served ripgrep
well, and it probably could continue to serve ripgrep well, but I ended
up deciding to move off of it.
Why?
The first time I had the thought of moving off of Clap was during the
2->3->4 transition. I thought the 3.x and 4.x releases were great, but
for me, it ended up moving a little too quickly. Since the release of
4.x was telegraphed around when 3.x came out, I decided to just hold off
and wait to migrate to 4.x instead of doing a 3.x migration followed
shortly by another 4.x migration. Of course, I just never ended up doing
the migration at all. I never got around to it and there just wasn't a
compelling reason for me to upgrade. While I never investigated it, I
saw an upgrade as a non-trivial amount of work in part because I didn't
encapsulate the usage of Clap enough.
The above is just what got me started thinking about it. It wasn't
enough to get me to move off of it on its own. What ended up pushing me
over the edge was a combination of factors:
* As mentioned above, I didn't want to run on the migration treadmill.
This has proven to not be much of an issue, but at the time of the
2->3->4 releases, I didn't know how long Clap 4.x would be out before a
5.x would come out.
* The release of lexopt[1] caught my eye. IMO, that crate demonstrates
exactly how something new can arrive on the scene and just thoroughly
solve a problem minimalistically. It has the docs, the reasoning, the
simple API, the tests and good judgment. It gets all the weird corner
cases right that Clap also gets right (and is part of why I was
originally attracted to Clap).
* I have an overall desire to reduce the size of my dependency tree. In
part because a smaller dependency tree tends to correlate with better
compile times, but also in part because it reduces my reliance and trust
on others. It lets me be the "master" of ripgrep's destiny by reducing
the amount of behavior that is the result of someone else's decision
(whether good or bad).
* I perceived that Clap solves a more general problem than what I
actually need solved. Despite the vast number of flags that ripgrep has,
its requirements are actually pretty simple. We just need simple
switches and flags that support one value. No multi-value flags. No
sub-commands. And probably a lot of other functionality that Clap has
that makes it so flexible for so many different use cases. (I'm being
hand wavy on the last point.)
With all that said, perhaps most importantly, the future of ripgrep
possibly demands a more flexible CLI argument parser. In today's world,
I would really like, for example, flags like `--type` and `--type-not`
to be able to accumulate their repeated values into a single sequence
while respecting the order they appear on the CLI. For example, prior
to this migration, `rg regex-automata -Tlock -ttoml` would not return
results in `Cargo.lock` in this repository because the `-Tlock` always
took priority even though `-ttoml` appeared after it. But with this
migration, `-ttoml` now correctly overrides `-Tlock`. We would like to
do similar things for `-g/--glob` and `--iglob` and potentially even
now introduce a `-G/--glob-not` flag instead of requiring users to use
`!` to negate a glob. (Which I had done originally to work-around this
problem.) And some day, I'd like to add some kind of boolean matching to
ripgrep perhaps similar to how `git grep` does it. (Although I haven't
thought too carefully on a design yet.) In order to do that, I perceive
it would be difficult to implement correctly in Clap.
I believe that this last point is possible to implement correctly in
Clap 2.x, although it is awkward to do so. I have not looked closely
enough at the Clap 4.x API to know whether it's still possible there. In
any case, these were enough reasons to move off of Clap and own more of
the argument parsing process myself.
This did require a few things:
* I had to write my own logic for how arguments are combined into one
single state object. Of course, I wanted this. This was part of the
upside. But it's still code I didn't have to write for Clap.
* I had to write my own shell completion generator.
* I had to write my own `-h/--help` output generator.
* I also had to write my own man page generator. Well, I had to do this
with Clap 2.x too, although my understanding is that Clap 4.x supports
this. With that said, without having tried it, my guess is that I
probably wouldn't have liked the output it generated because I
ultimately had to write most of the roff by hand myself to get the man
page I wanted. (This also had the benefit of dropping the build
dependency on asciidoc/asciidoctor.)
While this is definitely a fair bit of extra work, it overall only cost
me a couple days. IMO, that's a good trade off given that this code is
unlikely to change again in any substantial way. And it should also
allow for more flexible semantics going forward.
Fixes #884, Fixes #1648, Fixes #1701, Fixes #1814, Fixes #1966
[1]: https://docs.rs/lexopt/0.3.0/lexopt/index.html
2023-10-17 00:05:39 +02:00
|
|
|
"textwrap",
|
2020-08-20 00:55:16 +02:00
|
|
|
"walkdir",
|
2017-10-29 00:32:43 +02:00
|
|
|
]
|
|
|
|
|
2018-08-20 13:39:43 +02:00
|
|
|
[[package]]
|
|
|
|
name = "ryu"
|
2023-08-15 17:09:46 +02:00
|
|
|
version = "1.0.15"
|
2018-08-20 13:39:43 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-08-15 17:09:46 +02:00
|
|
|
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
|
2018-08-20 13:39:43 +02:00
|
|
|
|
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
|
|
|
[[package]]
|
|
|
|
name = "same-file"
|
2020-01-17 02:47:23 +02:00
|
|
|
version = "1.0.6"
|
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
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2020-08-20 00:55:16 +02:00
|
|
|
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
|
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
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"winapi-util",
|
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
|
|
|
]
|
|
|
|
|
2023-08-21 19:58:27 +02:00
|
|
|
[[package]]
|
|
|
|
name = "scopeguard"
|
|
|
|
version = "1.2.0"
|
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
|
|
|
2018-04-29 15:29:52 +02:00
|
|
|
[[package]]
|
|
|
|
name = "serde"
|
2023-11-21 15:10:04 +02:00
|
|
|
version = "1.0.193"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-11-21 15:10:04 +02:00
|
|
|
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
|
2021-06-02 02:45:45 +02:00
|
|
|
dependencies = [
|
|
|
|
"serde_derive",
|
|
|
|
]
|
2018-04-29 15:29:52 +02:00
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "serde_derive"
|
2023-11-21 15:10:04 +02:00
|
|
|
version = "1.0.193"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-11-21 15:10:04 +02:00
|
|
|
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"proc-macro2",
|
|
|
|
"quote",
|
|
|
|
"syn",
|
2018-04-29 15:29:52 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "serde_json"
|
2023-09-19 03:42:32 +02:00
|
|
|
version = "1.0.107"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-09-19 03:42:32 +02:00
|
|
|
checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"itoa",
|
|
|
|
"ryu",
|
|
|
|
"serde",
|
2018-04-29 15:29:52 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "syn"
|
2023-10-10 00:23:43 +02:00
|
|
|
version = "2.0.38"
|
2018-04-29 15:29:52 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-10-10 00:23:43 +02:00
|
|
|
checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
|
2018-04-29 15:29:52 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"proc-macro2",
|
|
|
|
"quote",
|
2022-12-20 16:23:29 +02:00
|
|
|
"unicode-ident",
|
2018-04-29 15:29:52 +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
|
|
|
[[package]]
|
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
|
|
|
name = "termcolor"
|
cli: replace clap with lexopt and supporting code
ripgrep began it's life with docopt for argument parsing. Then it moved
to Clap and stayed there for a number of years. Clap has served ripgrep
well, and it probably could continue to serve ripgrep well, but I ended
up deciding to move off of it.
Why?
The first time I had the thought of moving off of Clap was during the
2->3->4 transition. I thought the 3.x and 4.x releases were great, but
for me, it ended up moving a little too quickly. Since the release of
4.x was telegraphed around when 3.x came out, I decided to just hold off
and wait to migrate to 4.x instead of doing a 3.x migration followed
shortly by another 4.x migration. Of course, I just never ended up doing
the migration at all. I never got around to it and there just wasn't a
compelling reason for me to upgrade. While I never investigated it, I
saw an upgrade as a non-trivial amount of work in part because I didn't
encapsulate the usage of Clap enough.
The above is just what got me started thinking about it. It wasn't
enough to get me to move off of it on its own. What ended up pushing me
over the edge was a combination of factors:
* As mentioned above, I didn't want to run on the migration treadmill.
This has proven to not be much of an issue, but at the time of the
2->3->4 releases, I didn't know how long Clap 4.x would be out before a
5.x would come out.
* The release of lexopt[1] caught my eye. IMO, that crate demonstrates
exactly how something new can arrive on the scene and just thoroughly
solve a problem minimalistically. It has the docs, the reasoning, the
simple API, the tests and good judgment. It gets all the weird corner
cases right that Clap also gets right (and is part of why I was
originally attracted to Clap).
* I have an overall desire to reduce the size of my dependency tree. In
part because a smaller dependency tree tends to correlate with better
compile times, but also in part because it reduces my reliance and trust
on others. It lets me be the "master" of ripgrep's destiny by reducing
the amount of behavior that is the result of someone else's decision
(whether good or bad).
* I perceived that Clap solves a more general problem than what I
actually need solved. Despite the vast number of flags that ripgrep has,
its requirements are actually pretty simple. We just need simple
switches and flags that support one value. No multi-value flags. No
sub-commands. And probably a lot of other functionality that Clap has
that makes it so flexible for so many different use cases. (I'm being
hand wavy on the last point.)
With all that said, perhaps most importantly, the future of ripgrep
possibly demands a more flexible CLI argument parser. In today's world,
I would really like, for example, flags like `--type` and `--type-not`
to be able to accumulate their repeated values into a single sequence
while respecting the order they appear on the CLI. For example, prior
to this migration, `rg regex-automata -Tlock -ttoml` would not return
results in `Cargo.lock` in this repository because the `-Tlock` always
took priority even though `-ttoml` appeared after it. But with this
migration, `-ttoml` now correctly overrides `-Tlock`. We would like to
do similar things for `-g/--glob` and `--iglob` and potentially even
now introduce a `-G/--glob-not` flag instead of requiring users to use
`!` to negate a glob. (Which I had done originally to work-around this
problem.) And some day, I'd like to add some kind of boolean matching to
ripgrep perhaps similar to how `git grep` does it. (Although I haven't
thought too carefully on a design yet.) In order to do that, I perceive
it would be difficult to implement correctly in Clap.
I believe that this last point is possible to implement correctly in
Clap 2.x, although it is awkward to do so. I have not looked closely
enough at the Clap 4.x API to know whether it's still possible there. In
any case, these were enough reasons to move off of Clap and own more of
the argument parsing process myself.
This did require a few things:
* I had to write my own logic for how arguments are combined into one
single state object. Of course, I wanted this. This was part of the
upside. But it's still code I didn't have to write for Clap.
* I had to write my own shell completion generator.
* I had to write my own `-h/--help` output generator.
* I also had to write my own man page generator. Well, I had to do this
with Clap 2.x too, although my understanding is that Clap 4.x supports
this. With that said, without having tried it, my guess is that I
probably wouldn't have liked the output it generated because I
ultimately had to write most of the roff by hand myself to get the man
page I wanted. (This also had the benefit of dropping the build
dependency on asciidoc/asciidoctor.)
While this is definitely a fair bit of extra work, it overall only cost
me a couple days. IMO, that's a good trade off given that this code is
unlikely to change again in any substantial way. And it should also
allow for more flexible semantics going forward.
Fixes #884, Fixes #1648, Fixes #1701, Fixes #1814, Fixes #1966
[1]: https://docs.rs/lexopt/0.3.0/lexopt/index.html
2023-10-17 00:05:39 +02:00
|
|
|
version = "1.4.0"
|
2018-07-18 00:37:02 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
cli: replace clap with lexopt and supporting code
ripgrep began it's life with docopt for argument parsing. Then it moved
to Clap and stayed there for a number of years. Clap has served ripgrep
well, and it probably could continue to serve ripgrep well, but I ended
up deciding to move off of it.
Why?
The first time I had the thought of moving off of Clap was during the
2->3->4 transition. I thought the 3.x and 4.x releases were great, but
for me, it ended up moving a little too quickly. Since the release of
4.x was telegraphed around when 3.x came out, I decided to just hold off
and wait to migrate to 4.x instead of doing a 3.x migration followed
shortly by another 4.x migration. Of course, I just never ended up doing
the migration at all. I never got around to it and there just wasn't a
compelling reason for me to upgrade. While I never investigated it, I
saw an upgrade as a non-trivial amount of work in part because I didn't
encapsulate the usage of Clap enough.
The above is just what got me started thinking about it. It wasn't
enough to get me to move off of it on its own. What ended up pushing me
over the edge was a combination of factors:
* As mentioned above, I didn't want to run on the migration treadmill.
This has proven to not be much of an issue, but at the time of the
2->3->4 releases, I didn't know how long Clap 4.x would be out before a
5.x would come out.
* The release of lexopt[1] caught my eye. IMO, that crate demonstrates
exactly how something new can arrive on the scene and just thoroughly
solve a problem minimalistically. It has the docs, the reasoning, the
simple API, the tests and good judgment. It gets all the weird corner
cases right that Clap also gets right (and is part of why I was
originally attracted to Clap).
* I have an overall desire to reduce the size of my dependency tree. In
part because a smaller dependency tree tends to correlate with better
compile times, but also in part because it reduces my reliance and trust
on others. It lets me be the "master" of ripgrep's destiny by reducing
the amount of behavior that is the result of someone else's decision
(whether good or bad).
* I perceived that Clap solves a more general problem than what I
actually need solved. Despite the vast number of flags that ripgrep has,
its requirements are actually pretty simple. We just need simple
switches and flags that support one value. No multi-value flags. No
sub-commands. And probably a lot of other functionality that Clap has
that makes it so flexible for so many different use cases. (I'm being
hand wavy on the last point.)
With all that said, perhaps most importantly, the future of ripgrep
possibly demands a more flexible CLI argument parser. In today's world,
I would really like, for example, flags like `--type` and `--type-not`
to be able to accumulate their repeated values into a single sequence
while respecting the order they appear on the CLI. For example, prior
to this migration, `rg regex-automata -Tlock -ttoml` would not return
results in `Cargo.lock` in this repository because the `-Tlock` always
took priority even though `-ttoml` appeared after it. But with this
migration, `-ttoml` now correctly overrides `-Tlock`. We would like to
do similar things for `-g/--glob` and `--iglob` and potentially even
now introduce a `-G/--glob-not` flag instead of requiring users to use
`!` to negate a glob. (Which I had done originally to work-around this
problem.) And some day, I'd like to add some kind of boolean matching to
ripgrep perhaps similar to how `git grep` does it. (Although I haven't
thought too carefully on a design yet.) In order to do that, I perceive
it would be difficult to implement correctly in Clap.
I believe that this last point is possible to implement correctly in
Clap 2.x, although it is awkward to do so. I have not looked closely
enough at the Clap 4.x API to know whether it's still possible there. In
any case, these were enough reasons to move off of Clap and own more of
the argument parsing process myself.
This did require a few things:
* I had to write my own logic for how arguments are combined into one
single state object. Of course, I wanted this. This was part of the
upside. But it's still code I didn't have to write for Clap.
* I had to write my own shell completion generator.
* I had to write my own `-h/--help` output generator.
* I also had to write my own man page generator. Well, I had to do this
with Clap 2.x too, although my understanding is that Clap 4.x supports
this. With that said, without having tried it, my guess is that I
probably wouldn't have liked the output it generated because I
ultimately had to write most of the roff by hand myself to get the man
page I wanted. (This also had the benefit of dropping the build
dependency on asciidoc/asciidoctor.)
While this is definitely a fair bit of extra work, it overall only cost
me a couple days. IMO, that's a good trade off given that this code is
unlikely to change again in any substantial way. And it should also
allow for more flexible semantics going forward.
Fixes #884, Fixes #1648, Fixes #1701, Fixes #1814, Fixes #1966
[1]: https://docs.rs/lexopt/0.3.0/lexopt/index.html
2023-10-17 00:05:39 +02:00
|
|
|
checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449"
|
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
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"winapi-util",
|
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
|
|
|
]
|
|
|
|
|
2017-07-31 00:04:49 +02:00
|
|
|
[[package]]
|
|
|
|
name = "textwrap"
|
cli: replace clap with lexopt and supporting code
ripgrep began it's life with docopt for argument parsing. Then it moved
to Clap and stayed there for a number of years. Clap has served ripgrep
well, and it probably could continue to serve ripgrep well, but I ended
up deciding to move off of it.
Why?
The first time I had the thought of moving off of Clap was during the
2->3->4 transition. I thought the 3.x and 4.x releases were great, but
for me, it ended up moving a little too quickly. Since the release of
4.x was telegraphed around when 3.x came out, I decided to just hold off
and wait to migrate to 4.x instead of doing a 3.x migration followed
shortly by another 4.x migration. Of course, I just never ended up doing
the migration at all. I never got around to it and there just wasn't a
compelling reason for me to upgrade. While I never investigated it, I
saw an upgrade as a non-trivial amount of work in part because I didn't
encapsulate the usage of Clap enough.
The above is just what got me started thinking about it. It wasn't
enough to get me to move off of it on its own. What ended up pushing me
over the edge was a combination of factors:
* As mentioned above, I didn't want to run on the migration treadmill.
This has proven to not be much of an issue, but at the time of the
2->3->4 releases, I didn't know how long Clap 4.x would be out before a
5.x would come out.
* The release of lexopt[1] caught my eye. IMO, that crate demonstrates
exactly how something new can arrive on the scene and just thoroughly
solve a problem minimalistically. It has the docs, the reasoning, the
simple API, the tests and good judgment. It gets all the weird corner
cases right that Clap also gets right (and is part of why I was
originally attracted to Clap).
* I have an overall desire to reduce the size of my dependency tree. In
part because a smaller dependency tree tends to correlate with better
compile times, but also in part because it reduces my reliance and trust
on others. It lets me be the "master" of ripgrep's destiny by reducing
the amount of behavior that is the result of someone else's decision
(whether good or bad).
* I perceived that Clap solves a more general problem than what I
actually need solved. Despite the vast number of flags that ripgrep has,
its requirements are actually pretty simple. We just need simple
switches and flags that support one value. No multi-value flags. No
sub-commands. And probably a lot of other functionality that Clap has
that makes it so flexible for so many different use cases. (I'm being
hand wavy on the last point.)
With all that said, perhaps most importantly, the future of ripgrep
possibly demands a more flexible CLI argument parser. In today's world,
I would really like, for example, flags like `--type` and `--type-not`
to be able to accumulate their repeated values into a single sequence
while respecting the order they appear on the CLI. For example, prior
to this migration, `rg regex-automata -Tlock -ttoml` would not return
results in `Cargo.lock` in this repository because the `-Tlock` always
took priority even though `-ttoml` appeared after it. But with this
migration, `-ttoml` now correctly overrides `-Tlock`. We would like to
do similar things for `-g/--glob` and `--iglob` and potentially even
now introduce a `-G/--glob-not` flag instead of requiring users to use
`!` to negate a glob. (Which I had done originally to work-around this
problem.) And some day, I'd like to add some kind of boolean matching to
ripgrep perhaps similar to how `git grep` does it. (Although I haven't
thought too carefully on a design yet.) In order to do that, I perceive
it would be difficult to implement correctly in Clap.
I believe that this last point is possible to implement correctly in
Clap 2.x, although it is awkward to do so. I have not looked closely
enough at the Clap 4.x API to know whether it's still possible there. In
any case, these were enough reasons to move off of Clap and own more of
the argument parsing process myself.
This did require a few things:
* I had to write my own logic for how arguments are combined into one
single state object. Of course, I wanted this. This was part of the
upside. But it's still code I didn't have to write for Clap.
* I had to write my own shell completion generator.
* I had to write my own `-h/--help` output generator.
* I also had to write my own man page generator. Well, I had to do this
with Clap 2.x too, although my understanding is that Clap 4.x supports
this. With that said, without having tried it, my guess is that I
probably wouldn't have liked the output it generated because I
ultimately had to write most of the roff by hand myself to get the man
page I wanted. (This also had the benefit of dropping the build
dependency on asciidoc/asciidoctor.)
While this is definitely a fair bit of extra work, it overall only cost
me a couple days. IMO, that's a good trade off given that this code is
unlikely to change again in any substantial way. And it should also
allow for more flexible semantics going forward.
Fixes #884, Fixes #1648, Fixes #1701, Fixes #1814, Fixes #1966
[1]: https://docs.rs/lexopt/0.3.0/lexopt/index.html
2023-10-17 00:05:39 +02:00
|
|
|
version = "0.16.0"
|
2017-07-31 00:04:49 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
cli: replace clap with lexopt and supporting code
ripgrep began it's life with docopt for argument parsing. Then it moved
to Clap and stayed there for a number of years. Clap has served ripgrep
well, and it probably could continue to serve ripgrep well, but I ended
up deciding to move off of it.
Why?
The first time I had the thought of moving off of Clap was during the
2->3->4 transition. I thought the 3.x and 4.x releases were great, but
for me, it ended up moving a little too quickly. Since the release of
4.x was telegraphed around when 3.x came out, I decided to just hold off
and wait to migrate to 4.x instead of doing a 3.x migration followed
shortly by another 4.x migration. Of course, I just never ended up doing
the migration at all. I never got around to it and there just wasn't a
compelling reason for me to upgrade. While I never investigated it, I
saw an upgrade as a non-trivial amount of work in part because I didn't
encapsulate the usage of Clap enough.
The above is just what got me started thinking about it. It wasn't
enough to get me to move off of it on its own. What ended up pushing me
over the edge was a combination of factors:
* As mentioned above, I didn't want to run on the migration treadmill.
This has proven to not be much of an issue, but at the time of the
2->3->4 releases, I didn't know how long Clap 4.x would be out before a
5.x would come out.
* The release of lexopt[1] caught my eye. IMO, that crate demonstrates
exactly how something new can arrive on the scene and just thoroughly
solve a problem minimalistically. It has the docs, the reasoning, the
simple API, the tests and good judgment. It gets all the weird corner
cases right that Clap also gets right (and is part of why I was
originally attracted to Clap).
* I have an overall desire to reduce the size of my dependency tree. In
part because a smaller dependency tree tends to correlate with better
compile times, but also in part because it reduces my reliance and trust
on others. It lets me be the "master" of ripgrep's destiny by reducing
the amount of behavior that is the result of someone else's decision
(whether good or bad).
* I perceived that Clap solves a more general problem than what I
actually need solved. Despite the vast number of flags that ripgrep has,
its requirements are actually pretty simple. We just need simple
switches and flags that support one value. No multi-value flags. No
sub-commands. And probably a lot of other functionality that Clap has
that makes it so flexible for so many different use cases. (I'm being
hand wavy on the last point.)
With all that said, perhaps most importantly, the future of ripgrep
possibly demands a more flexible CLI argument parser. In today's world,
I would really like, for example, flags like `--type` and `--type-not`
to be able to accumulate their repeated values into a single sequence
while respecting the order they appear on the CLI. For example, prior
to this migration, `rg regex-automata -Tlock -ttoml` would not return
results in `Cargo.lock` in this repository because the `-Tlock` always
took priority even though `-ttoml` appeared after it. But with this
migration, `-ttoml` now correctly overrides `-Tlock`. We would like to
do similar things for `-g/--glob` and `--iglob` and potentially even
now introduce a `-G/--glob-not` flag instead of requiring users to use
`!` to negate a glob. (Which I had done originally to work-around this
problem.) And some day, I'd like to add some kind of boolean matching to
ripgrep perhaps similar to how `git grep` does it. (Although I haven't
thought too carefully on a design yet.) In order to do that, I perceive
it would be difficult to implement correctly in Clap.
I believe that this last point is possible to implement correctly in
Clap 2.x, although it is awkward to do so. I have not looked closely
enough at the Clap 4.x API to know whether it's still possible there. In
any case, these were enough reasons to move off of Clap and own more of
the argument parsing process myself.
This did require a few things:
* I had to write my own logic for how arguments are combined into one
single state object. Of course, I wanted this. This was part of the
upside. But it's still code I didn't have to write for Clap.
* I had to write my own shell completion generator.
* I had to write my own `-h/--help` output generator.
* I also had to write my own man page generator. Well, I had to do this
with Clap 2.x too, although my understanding is that Clap 4.x supports
this. With that said, without having tried it, my guess is that I
probably wouldn't have liked the output it generated because I
ultimately had to write most of the roff by hand myself to get the man
page I wanted. (This also had the benefit of dropping the build
dependency on asciidoc/asciidoctor.)
While this is definitely a fair bit of extra work, it overall only cost
me a couple days. IMO, that's a good trade off given that this code is
unlikely to change again in any substantial way. And it should also
allow for more flexible semantics going forward.
Fixes #884, Fixes #1648, Fixes #1701, Fixes #1814, Fixes #1966
[1]: https://docs.rs/lexopt/0.3.0/lexopt/index.html
2023-10-17 00:05:39 +02:00
|
|
|
checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d"
|
2017-07-31 00:04:49 +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
|
|
|
[[package]]
|
2022-12-20 16:23:29 +02:00
|
|
|
name = "unicode-ident"
|
2023-09-19 03:42:32 +02:00
|
|
|
version = "1.0.12"
|
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
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-09-19 03:42:32 +02:00
|
|
|
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
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
|
|
|
|
2016-09-12 01:06:05 +02:00
|
|
|
[[package]]
|
|
|
|
name = "walkdir"
|
2023-09-19 03:42:32 +02:00
|
|
|
version = "2.4.0"
|
2016-09-12 01:06:05 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-09-19 03:42:32 +02:00
|
|
|
checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee"
|
2016-09-12 01:06:05 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"same-file",
|
|
|
|
"winapi-util",
|
2016-09-12 01:06:05 +02:00
|
|
|
]
|
|
|
|
|
2017-12-30 22:48:25 +02:00
|
|
|
[[package]]
|
|
|
|
name = "winapi"
|
2020-11-02 17:06:13 +02:00
|
|
|
version = "0.3.9"
|
2017-12-30 22:48:25 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2020-11-02 17:06:13 +02:00
|
|
|
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
2017-12-30 22:48:25 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"winapi-i686-pc-windows-gnu",
|
|
|
|
"winapi-x86_64-pc-windows-gnu",
|
2017-12-30 22:48:25 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[[package]]
|
|
|
|
name = "winapi-i686-pc-windows-gnu"
|
2018-02-11 20:31:41 +02:00
|
|
|
version = "0.4.0"
|
2017-12-30 22:48:25 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2020-08-20 00:55:16 +02:00
|
|
|
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
2017-12-30 22:48:25 +02:00
|
|
|
|
2018-08-25 06:19:40 +02:00
|
|
|
[[package]]
|
|
|
|
name = "winapi-util"
|
2023-09-20 20:42:03 +02:00
|
|
|
version = "0.1.6"
|
2018-08-25 06:19:40 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2023-09-20 20:42:03 +02:00
|
|
|
checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
|
2018-08-25 06:19:40 +02:00
|
|
|
dependencies = [
|
2020-08-20 00:55:16 +02:00
|
|
|
"winapi",
|
2018-08-25 06:19:40 +02:00
|
|
|
]
|
|
|
|
|
2017-12-30 22:48:25 +02:00
|
|
|
[[package]]
|
|
|
|
name = "winapi-x86_64-pc-windows-gnu"
|
2018-02-11 20:31:41 +02:00
|
|
|
version = "0.4.0"
|
2017-12-30 22:48:25 +02:00
|
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
2020-08-20 00:55:16 +02:00
|
|
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|