5 Nov 2024 |
SmokeMachine |
shouldn't it? |
11:46 |
|
lizmat |
I think the Callable is wrong |
11:49 |
|
|
it should be something like: { try { $_ if .slurp.AST... } }, ... |
|
|
SmokeMachine |
a simpler example: usercontent.irccloud-cdn.com/file/.../image.png |
11:54 |
|
lizmat |
the reason you get the contents, is because the callable returns the contents, instead of True or False |
11:56 |
|
SmokeMachine |
so I should return the IO? |
|
|
|
but is there a way to print the custom value and the filename? |
11:57 |
|
lizmat |
you determine that by what you return in the Callable |
12:00 |
|
|
could well be anything |
|
|
SmokeMachine |
I mean, on my case I'm searching for specific AST on many files of code, and I want to return the name of the files where that ast was found and the ast itself... |
|
|
lizmat |
so, why did you specify :find then ? |
|
|
SmokeMachine |
because otherwise my callable would receice each line, instead of the IO... |
12:01 |
|
lizmat |
and why not use the "rak" CLI ? |
|
|
|
aah... --per-file |
|
|
|
not sure what that is in the rak module |
|
|
|
the mapping of cli opts to args to the "rak" sub is not always 1 one 1 |
12:02 |
|
|
fwiw, it feels that your use of "rak" is a bit of overkill |
12:06 |
|
SmokeMachine |
and I'm not using the rak cli because it seems to not be importing the exports of modules (or I am doing something wrong) (github.com/lizmat/rak/issues/5) usercontent.irccloud-cdn.com/file/.../image.png |
|
|
lizmat |
feels to me raku.land/zef:lizmat/paths should be enough to make a file selection |
12:07 |
|
|
and then .IO.slurp do you thing on what that produces |
|
|
SmokeMachine |
I'll give a try on `path`, thanks! |
12:08 |
|
|
what about the --module? |
12:09 |
|
lizmat |
there's an issue for it... didn't get around to looking at that yet |
|
|
tbrowder |
ah, paths my be what i need, too! |
12:10 |
|
|
*may be |
|
|
SmokeMachine |
lizmat: thanks! |
|
|
|
lizmat: it seems `paths` is working well on my case, thanks! usercontent.irccloud-cdn.com/file/.../image.png |
12:18 |
|
lizmat |
paths(:file(*.ends-with(".rakumod")) would be faster :-) |
12:20 |
|
|
and then $file.IO.slurp |
|
|
|
prevents a lot of IO::Path objects from being made |
12:21 |
|
SmokeMachine |
working well, thanks! Now, my next step is to fix the array inside array on named results on ASTQuery, (not related to rak nor paths), thanks! usercontent.irccloud-cdn.com/file/.../image.png |
12:23 |
|
lizmat |
yw |
12:24 |
|
tbrowder |
lizmat: paths IS what i need, sorry for the bother, but it might be worth mention ing module "paths" in the rak docs. |
12:26 |
|
|
thank you very much! |
12:27 |
|
|
hm, how about pairing 'paths' with 'App::Rak' to get the equiv of Gnu find? |
17:43 |
|
|
maybe allow something like : $rak = rak {paths(@dirs)} , :named1, :etc; |
17:46 |
|
lizmat |
$ rak --find |
17:51 |
|
|
should already be very close to GU find in functionaliy ? |
|
|
|
$ rak foo --find |
17:52 |
|
|
will find all files with "foo" in their name |
|
|
tbrowder |
yes, i think i see how to use it as a CLI cmd. i’ll have to experiment some more, though. |
23:24 |
|
|
i’m working on a PR for rak doc tweaks to help us weaker-minded users apply it as simply as possible 😁 |
23:26 |
|
lizmat |
nice |
23:29 |
|
|
meanwhile I'm going for some shuteye & |
|
|
tbrowder |
nitey nite |
23:58 |
|
13 Dec 2024 |
[Coke] |
how to print just matches and not line numbers? |
14:34 |
|
lizmat |
--/show-item-number |
14:36 |
|
[Coke] |
should **Stopped showing results after...** be emitted on ERR instead of OUT? |
15:47 |
|
|
IWBNI if the readme for github.com/lizmat/rak had a link near the top for github.com/lizmat/App-Rak |
15:49 |
|
|
Q: why is the default settings name "(default)" and not "default" ? |
15:52 |
|
lizmat |
could you make issues for those, I'm afraid they will otherwise fall through the cracks :-) |
|
|
[Coke] |
Done |
15:57 |
|
lizmat |
[Coke]++ |
15:58 |
|