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

`ug -TrinΙ` is invalid, but `ug -ITrin` isn't? #375

Closed stdedos closed 5 months ago

stdedos commented 5 months ago
$ sudo ug -TrinΙ contract_url /
ugrep: invalid option -Ι
For more help on options, try `ugrep --help' or `ugrep --help -Ι'
$ sudo ug -ITrin contract_url /
/etc/ubuntu-advantage/uaclient.conf
...

Searched 1904281 files in 249708 directories in 88.3 seconds with 12 threads: 10 matching (0.0005251%)
Searched 528784672 lines: 23 matching (4.35e-06%)
Received 4841 warnings
The following pathname selections and search constraints were applied:
  --config=.ugrep
    using .ugrep
  --directories=recurse
  --no-hidden (default)
  --sort=name
Lines matched ignoring case if:
  "contract_url" matches

However, it seems that also the post-script is not listing it? 😕 (but the search has finished amazingly fast, I don't think that's it exactly)

$ ug -v
ugrep 4.5.2 x86_64-pc-linux-gnu +avx2; -P:pcre2jit; -z:zlib,bzip2,lzma,lz4,zstd
License: BSD-3-Clause; ugrep user manual:  https://ugrep.com
Written by Robert van Engelen and others:  https://github.com/Genivia/ugrep
Ugrep utilizes the RE/flex regex library:  https://github.com/Genivia/RE-flex

I know I have an outdated version, but sadly I haven't had the time to rebuild 😕

genivia-inc commented 5 months ago

This is super easy to figure out: you've used U+0399 "GREEK CAPITAL LETTER IOTA or UTF-8 ce 99 instead of option I:

$ echo -TrinΙ | ug -X ''
     1: 
00000000  2d 54 72 69 6e ce 99 0a  -- -- -- -- -- -- -- --  |-Trin..J--------|

Of course that would be flagged as invalid.

stdedos commented 4 months ago

Apologies :sweat_smile: They did look the same, even when using monospaced fonts