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.57k stars 109 forks source link

Using `-o -CN` mixes `:` and `+` delimiters #317

Closed postsolar closed 10 months ago

postsolar commented 10 months ago

If I do

> ug -o -C20 -Ink pattern --color=always

I will get lines with : and lines with + used as delimiters, which doesn't compose well with other tools like fzf.

My suggestion: add an option to explicitly set the delimiter.

genivia-inc commented 10 months ago

The default : delimiter is changed with --separator=xyz. Same as GNU grep. This option replaces the default :, + (same line) and | (match spans multiple lines) separators with the specified xyz string.

postsolar commented 10 months ago

I saw this flag, but it gave me errors, so I assumed it's not what I'm thinking it is. Now after this sanity check I understand I've been using it like --separator 'xyz', without the =. Thank you!

genivia-inc commented 10 months ago

You may want to specify separator=xyz in your .ugrep file to permanently change it, if that's what you prefer.

genivia-inc commented 9 months ago

I'm thinking that + should be removed as a separator and just be a :. Ugrep should be compatible with GNU grep without requiring a --separator. The + isn't all that useful actually, since it was just meant to be a minor visual aid. Will consider removing + in the upcoming release cycle.

postsolar commented 9 months ago

Makes sense — the visual aid is already provided by ellipses.