lizmat / App-Rak

21st century grep / find / ack / ag / rg on steroids
https://raku.land/zef:lizmat/App::Rak
Artistic License 2.0
153 stars 8 forks source link

Error / warning with pipe #33

Closed Zer0-Tolerance closed 2 years ago

Zer0-Tolerance commented 2 years ago

Another small bug, when you're running rak multiple time with | it creates an unexpected output:

$: echo 116.203.72.198 >> /tmp/t2
$: rak 11 /tmp/t2 | rak 1                                 19:30:11
Use of uninitialized value $source-for of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
  in sub move-filesystem-options-to-rak at /Users/.rakubrew/versions/moar-2022.07/share/perl6/site/sources/DB5D9DC1DFF0575D3090DE44DB3FFFDE5EC1A225 (App::Rak) line 2135
Use of uninitialized value $source-for of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
  in sub move-filesystem-options-to-rak at /Users/.rakubrew/versions/moar-2022.07/share/perl6/site/sources/DB5D9DC1DFF0575D3090DE44DB3FFFDE5EC1A225 (App::Rak) line 2135
../../../../../../tmp/t2:1:116.203.72.198

Any idea why it's doing this ?

lizmat commented 2 years ago

This should be fixed in the latest version. Did you try it with that?

Zer0-Tolerance commented 2 years ago

just tried I get this:

rak 11 /tmp/t2 | rak 1                                 19:48:57
<STDIN>
../../../../../../tmp/t2:1:116.203.72.198

is this the expected output ?

lizmat commented 2 years ago

I've been debating whether reading from STDIN should or should not show the "file" name.

--/show-filename

should get rid of the <STDIN>.

I guess if should become the default when reading from STDIN... hmmm

Zer0-Tolerance commented 2 years ago

I understand this is the expected output but I agree this is a bit unusual and should be hidden to avoid confusion. I'll close the issue as the bug is fixed in the latest version.

lizmat commented 2 years ago

https://github.com/lizmat/App-Rak/commit/c975f299c9 should fix the clutter