Genivia / ugrep

NEW ugrep 6.5: a more powerful, ultra fast, user-friendly, compatible grep. Includes a TUI, Google-like Boolean search with AND/OR/NOT, fuzzy search, hexdumps, searches (nested) archives (zip, 7z, tar, pax, cpio), compressed files (gz, Z, bz2, lzma, xz, lz4, zstd, brotli), pdfs, docs, and more
https://ugrep.com
BSD 3-Clause "New" or "Revised" License
2.56k stars 109 forks source link

drop in replacement didn't work? #347

Closed rdp closed 7 months ago

rdp commented 7 months ago
$ grep "libstdc++.dll.a" . -r
# works
$ ugrep "libstdc++.dll.a" . -r
ugrep: error: error in regex at position 12
(?m)libstdc++.dll.a
            \___invalid quantifier

Maybe expected? Thanks :)

genivia-inc commented 7 months ago

The drop-in replacement works if you rename ugrep to grep, egrep and fgrep. Then it automatically emulates grep with ugrep -G to behave like grep with BRE syntax. Otherwise, it is similar to egrep (grep -E) with ERE syntax. They are all different commands. Rename or symlink ugrep works.

There are comments about this in the README.

genivia-inc commented 7 months ago

I've updated the README to avoid confusion about the drop-in comment, with a link to the section in the README that describes the drop-in steps to take. Also ugrep.com is updated by adding point ii to briefly explain how ugrep works like grep, egrep and fgrep by making aliases or copy or link.

When ugrep is installed, we should not replace grep, egrep and fgrep automatically. That's not acceptable to users (and would likely be rejected by package managers, I would). Instead, users should rename/copy ugrep or symlink ugrep or create aliases as he/she wishes.

rdp commented 7 months ago

That does satisfy my initial confusion, and will hopefully help followers, thank you (though I'll admit it looks a bit daunting in the README, maybe could be a bit more terse and just link to it?), thanks for your help and attention! :)

genivia-inc commented 7 months ago

That does satisfy my initial confusion, and will hopefully help followers, thank you (though I'll admit it looks a bit daunting in the README, maybe could be a bit more terse and just link to it?), thanks for your help and attention! :)

Yeah, the README is long and I certainly don't expect or even want people to read it all. The ugrep.com web page is easier to navigate. It is short and concise. A point about aliases, copy/symlink is now also mentioned there, which hopefully helps to avoid confusion.