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

Bash autocompletion lost --no-confirm #394

Closed jack6th closed 3 months ago

jack6th commented 3 months ago

ugrep 6.0 --no-confirm works but it is not in the bash autocompletion list.

genivia-inc commented 3 months ago

The --no- prefix can be used with most options. So showing all --no- options in a list will be cumbersome, since it "spams" the output. There are a few use cases for --no- that we could add to the list. But I respectfully don't believe that --no-confirm should be one of them. It is useful in .ugrep configuration files but not so much from the command line. But I could be wrong.

genivia-inc commented 3 months ago

See commit ee64cc7

jack6th commented 3 months ago

Here is how I find the --no-confirm option. I open man page with 'man ug'. I find --confirm option with /confirm in the man page. But I do not find --no-confirm there. I input 'ug --no(press double TAB)' and there is no --no-confirm option. I tried 'ug -Q --comfirm false' and it does not work. I tried 'ug -Q --comfirm off' and it does not not work. I tried 'ug -Q --comfirm 0' and it does not not work. I tried 'ug -Q --no-comfirm' and it works. If all the options available are listed in the autocompletion list and man page I think it is helpful.

genivia-inc commented 3 months ago

The updated completions use --no-confirm as I've closed this. But ug 6.0.0 still lists --confirm and there is not plan to release a ug update only to fix such as tiny change that has no impact.

genivia-inc commented 3 months ago

I tried 'ug -Q --comfirm false' and it does not work. I tried 'ug -Q --comfirm off' and it does not not work. I tried 'ug -Q --comfirm 0' and it does not not work.

You do know that --confirm does not accept arguments, right? See --help confirm and the man page. And nope, --confirm no longer auto-completes because it is the default. Also, note that --help confirm clearly says that long options may start with --no- to disable:

Long options may start with `--no-' to disable, when applicable.
jack6th commented 3 months ago

I have tried ee64cc7 and it is faster. Thanks for your work. And I am sorry that I do not read the man page and --help from beginning to end. But it is another issue if --confirm no longer auto-completes. If user set --no-confirm in the .ugrep or alias, he need --confirm option to enable it on the command line. How about list all the options available in the auto completion list ? I do not think it is cumbersome. aria2c list 283 options in the autocompletion. It's simple and useful.

genivia-inc commented 3 months ago

How about list all the options available in the auto completion list ?

Well it does include all short and long options. It also includes several --no- long options, but not all. It doesn't make sense to list all long options again with the prefix --no-, because these are rarely ever used on the command line. Those could be used in config files or in aliases, for example.

genivia-inc commented 2 months ago

Completions are updated in release 6.1.