lizmat / App-Rak

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

Error / warning with pipe #33

Closed Zer0-Tolerance closed 1 year ago

Zer0-Tolerance commented 1 year 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 1 year ago

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

Zer0-Tolerance commented 1 year 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 1 year 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 1 year 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 1 year ago

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