lizmat / App-Rak

21st century grep / find / ack / ag / rg on steroids
Artistic License 2.0
152 stars 7 forks source link

Feature request: easy to implement combine --unique --count to compute number unique of items #39

Closed Zer0-Tolerance closed 5 days ago

Zer0-Tolerance commented 1 year ago

Hi Liz, it seems that in the latest version the --unique --count is not working as one would expect: rak "/./" file.txt --unique --count-only => should give the number of unique pattern but it only gives the count of non unique.

Or am I missing something ?

lizmat commented 1 year ago

Hmmm... I seem to recall that --count-only overrides --unique, but maybe it shouldn't.

Lemme mull on that... :-)

lizmat commented 3 months ago

This will requires some internal re-design. Mulling again.

Zer0-Tolerance commented 3 months ago

if one wants to get a count of unique values then you need to pipe it to an external command as sort -u if you use --count-only or wc -l if you use --unique ... it would really be better to have it in rak.

lizmat commented 3 months ago

Still mulling, didn't make it to the 0.2.24 release :-(

Zer0-Tolerance commented 3 months ago

ok maybe the next one ?

Zer0-Tolerance commented 2 months ago

up

lizmat commented 3 weeks ago

Finally getting back to this:

rak "/./" file.txt

would produce a match for each line, as /./ is a regex, and interpreted as a Bool. Is that what you expected? Or did you expect these semantics:

rak '{ ~$/ if /./ }' file.txt

which would match with the first character of each line.

lizmat commented 5 days ago

Fixed in release 0.3.7