lizmat / App-Rak

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

Use an environment variable to define default use #51

Closed tbrowder closed 3 months ago

tbrowder commented 7 months ago

My preferred, default use would be my most often find/grep use: searching for a word in a file in a subdirectory:

$ find . -type f -name "*.rakumod" -exec grep -i foo {} \; -print 

so I would like to encapsulate that for 'rak' use. Something like:

RAk_DEFAULT_ACTION='make rak act like my find/grep use'

A brief look at the many options of 'rak' makes me unsure if that can be done, but I have great confidence in your wielding of the power of Raku.

lizmat commented 7 months ago
$ rak --save=foo --extensions=rakumod --ignorecase  # do this once
$ rak --foo foo

Isn't that more flexible?

tbrowder commented 5 months ago

The current buzz about App::Rak reminded me to check here. I do think that is more flexible, but an env var for old coders would still be nice.

lizmat commented 3 months ago

Having thought about this some more, I don't feel that adding more environment variables to the already myriad of options, is going to be helpful.

If you really want to use environment variables, I suggest making a wrapper Raku script that would take the environment variable and convert that to the appropriate argument, and then run rak with it.

Closing this now. Please re-open if you disagree.