Genivia / ugrep

NEW ugrep 7.1: 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.66k stars 111 forks source link

Confused regarding no-results on a parent directory, while a lower parent directory has results #399

Closed AndydeCleyre closed 5 months ago

AndydeCleyre commented 5 months ago

Hello, and thanks!

I'm using ugrep 6.0.0, and it's going great, but I just came upon this case I don't understand.

I installed a package from PyPI, mbox-to-json. When using it had an interesting error, I used ug to start looking into it. The Python package is installed into a venv folder: ~/.local/share/venvs/9df51ab2396e42715bdacc1354121b82/venv.

I'm searching for the term alive_progress, invoking ug as:

$ ug --smart-case --glob-ignore-case --hidden alive_progress <FOLDER>
FOLDER Results
~/.local/share/venvs/9df51ab2396e42715bdacc1354121b82/venv None
~/.local/share/venvs/9df51ab2396e42715bdacc1354121b82/venv/lib None
~/.local/share/venvs/9df51ab2396e42715bdacc1354121b82/venv/lib/python3.10 None
~/.local/share/venvs/9df51ab2396e42715bdacc1354121b82/venv/lib/python3.10/site-packages None
~/.local/share/venvs/9df51ab2396e42715bdacc1354121b82/venv/lib/python3.10/site-packages/src extract.py, main.py
~/.local/share/venvs/9df51ab2396e42715bdacc1354121b82/venv/lib/python3.10/site-packages/src/* extract.py, main.py, __pycache__/main.cpython-310.pyc (binary)
genivia-inc commented 5 months ago

I am not sure I understand.

Like ls <FOLDER> shows the FOLDER contents only, ug <FOLDER> searches FOLDER only. Specify -r to search recursively. It's documented on ugrep.com at the very top how ug PATTERN DIR search works.

It is a choice I made. Don't know if it is the best choice, but the way GNU grep works with -Dread and -Drecurse (which is -r) and -Dskip is something that I want to be compatible with. GNU/BSD grep error out on searching a specified FOLDER unless -r (-Drecurse). So by default ug searches one level, or you can specify -2 or -3 etc to deepen.

AndydeCleyre commented 5 months ago

Oops, thanks! I'll update my aliases. I use the --help output for documentation, not the website, and forgot about or missed this.