2 ms·
xbps-query -RS ripgrep |sed -n 11,21p pkgname: ripgrep pkgver: ripgrep-14.0.3_1 repository: https://repo-default.voidlinux.org/current/musl
by 1vuio0pswjnm7 3y ago
xbps-query -RS ripgrep |sed -n 11,21p
pkgname: ripgrep
pkgver: ripgrep-14.0.3_1
repository: https://repo-default.voidlinux.org/current/musl
run_depends:
libgcc>=4.4.0_1
libpcre2>=10.22_1
musl>=1.1.24_7
shlib-requires:
libc.so
libgcc_s.so.1
libpcre2-8.so.0
It would be nice to have a ripgrep without libpcre2.
It also would be nice to use BRE by default and make ERE optional, similar to grep.
What would compiling ripgrep from source entail. Would it be as easy as compiling ired.
ired compiles in seconds and compiling requires less than 1MB of disk space. No connection to any server is required to compile the program.
Let's edit the 1.sh script to add the -F option and try our example search again to see what happens.
#!/bin/sh
read x;
case $# in :)
;;0)exec echo "usage: ${0##*/} file [chars before] [chars after]"
;;1)exec rg -F --no-unicode --block-buffered --color=never -NUo "$x" $1
esac
case $# in 2|3)printf "((.)|(\\\\n)|(\\\\r)){"$2"}$x((.)|(\\\\n)|(\\\\r)){"${3-0}"}";esac \
|rg -f/dev/stdin -F --no-unicode --block-buffered --color=never -NUo $1
echo \(|1.sh test.html
echo \(a|1.sh test.html 0 3
As expected, this produces no output.
We cannot add the surrounding context characters as literals because we do not know the identity of these characters. That is what we are attempting to find out.
Would I ever search for a repeating pattern such as \(a\(a using ired. The answer is no; I am looking for context. I would search for \(a and then add a request for context, a number characters before and/or after, as in the examples. Again, I do not know what those characters will be; that is what I am searching for. If the pattern repeats, this would be visible from viewing the context.
For line-delimited files where data is presented in a regular format, grep -A -B and -C work great for printing context. But for files that can be idiosyncratic in how they present data and/or files that lack consistent newline delimeters, for me, grep -o is inadequate for printing context.
- burntsushi 3y ago> It would be nice to have a ripgrep without libpcre2. Blame your packagers for that, not me. PCRE2 is an optional dependency that isn't enabled by default. If you bothered to read the README, you'd know that. Your packagers probably enable PCRE2 because nobody gives a fuck about a MB or two. And if you do, compile your own damn software. > It also would be nice to use BRE by default and make ERE optional, similar to grep. Disagree. No thanks. > What would compiling ripgrep from source entail. Would it be as easy as compiling ired. cargo build --release Read the docs maybe? > ired compiles in seconds and compiling requires less than 1MB of disk space. No connection to any server is required to compile the program. I don't care. Go talk to the Debian people. They know how to build Rust software without connecting to the Internet. Cargo supports that workflow, but it's not the default. ripgrep isn't minimalist software. Never was. Never will be. If that's a requirement, then tough cookies. > The answer is no; I am looking for context. And who knows if you'll find it with ired given that it doesn't implement substring search properly. I demonstrated this with a simple example days ago. You continue to ignore it. This is why your commentary is dishonest. You keep looking for other reasons to prop up ired. Shifting goalposts. And not even bothering to acknowledge that I already told you days ago that ripgrep and ired are two different tools. They don't target the same use cases. Go back to the start of our conversation. All I did was correct an erroneous complaint about perf where you snubbed your nose. Since then, you've hemmed and hawed and tried to turn this into a broader discussion about whether ripgrep can replace ired. I never said it could. rg -o might be able to hit some subset of ired faster than ired, but I don't claim anything beyond that. I mean obviously ripgrep works better on line oriented data. It is a grep! Your tunnel vision is so intense you can't even realize that you're trying to rationalize the use of broken software. Who the fuck cares if it's fast or let's you show windowed context if it can't even report every match? Fast and user friendly doesn't mean shit if it's wrong. The fact that you can't acknowledge that reveals the dishonesty in your commentary.