Live data from Hacker News

Show HN: A simple, fast and user-friendly alternative to find, written in Rust

github.com

221–225 of 225 posts

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#221

Earlier quoted context omitted.

What do you mean by a "invested in a Perl workflow"? Do you mean "comfortable with Perl regexes"? Other reasons that you may want to use ack: * You want to define your own filetypes * You want to define your own output using Perl regexes * You need the portability of an uncompiled tool in a single source file that you can drop into your ~/bin when you can't install or compile anything on the box. * You don't want to…

Thanks for writing Ack petdance! Nowadays I typically use 'git grep' but I still use ack a good amount.

You're very welcome. I'm glad it's made things easier. git grep, ag, rg, whatever: Just use whatever makes you happiest.

It's interesting how git grep makes the ack feature of "ignore your VCS dirs" not so important any more. I wonder how the grep-alike tool world would look if git weren't so dominant, and/or git didn't include its own grep.

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#222

Earlier quoted context omitted.

What do you mean by a "invested in a Perl workflow"? Do you mean "comfortable with Perl regexes"? Other reasons that you may want to use ack: * You want to define your own filetypes * You want to define your own output using Perl regexes * You need the portability of an uncompiled tool in a single source file that you can drop into your ~/bin when you can't install or compile anything on the box. * You don't want to…

I had real trouble getting ack to work when I first started using it. On Linux I had some trouble, I can’t remember what, but on Windows it was downright hard to get it to work properly. When using a new computer once I switched to ag one time because I was unable to get ack working on Windows. I believe that defining the output using Perl regexes was what I was referring to with “Perl magic powers”. I work at FastMa…

> they like Perl and ack and occasionally use some of that fancy superpower. I, on the other hand, lack that experience

One of the things I'm working on right now is a cookbook that will ship with ack 3, currently about thisclose from going to beta. I want to show examples of the magic powers and see how powerful it can be. Your comment reinforces in my mind that it's an important thing to have.

> I’m very glad that ack existed; it led the way with better tools, and I used it heavily for some years. Thanks for making it!

You're very welcome. I'm continually pleased to see what's come out after it. A search tool arms race is a good thing.

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#223

Earlier quoted context omitted.

ack still shines when I have a unique application to highlight one or more regex expressions in a log file because of its unique `--passthru` option, AND support of PCRE regex. So I can have regex like 'abc\K(def)(?=ghi)'. That will highlight ONLY 'def' in the text but only if that string is preceeded by 'abc' and 'ghi' follows. - ripgrep cannot do that as it does not support PCRE ag support --passthrough, but I have…

You don't need an explicit `--passthru` option. `rg '^|foo|bar|baz'` will print every line in the input while highlighting `foo`, `bar` and `baz`. I'm pretty sure the PCRE lookaround support you're referring to is exactly what the GP meant by "Perl magic powers."

Thanks. That's good to know, though it's impossible for rg to do something like this at the moment.. highlight different regexes in different colors. Note that support of \K from PCRE is really crucial for this.

    # Do "ack2 --help" to learn more (or "ack2 --man" to learn even more).
    alias ack_passthru '\ack2 -h --flush --passthru --color \!:*'

    # USAGE: SIM_COMMAND | hllog
    alias hllog "ack_passthru   --color-match='white on_red'   '(\*[FE],\w+):' \\
                 | ack_passthru --color-match='white on_red'   '^(Error-\[.*?\].*)' \\
                 | ack_passthru --color-match='white on_red'   '(\*[FE],\w+)\b.*?([a-zA-Z_.0-9]+),(\d+)|\d+' \\
                 | ack_passthru --color-match='white on_red'   '^FOO Info\s+::\s+\K([1-9][0-9]* Runs (Failed|Missing))' \\
                 | ack_passthru --color-match='red'            '^UVM_[EF][ROATL]+\s+:\s+[1-9][0-9]*' \\
                 | ack_passthru --color-match='black on_white' '(\*W,\w+):' \\
                 | ack_passthru --color-match='black on_white' '(\*W,\w+)\b.*?([a-zA-Z_.0-9]+),(\d+)|\d+' \\
                 | ack_passthru --color-match='black on_white' '^(Warning-\[.*?\].*)' \\
                 | ack_passthru --color-match='yellow'         '^UVM_WARNING\s+:\s+[1-9][0-9]*' \\
                 | ack_passthru --color-match='yellow'         '^FOO Info\s+::\s+\K([1-9][0-9]* Runs with Warnings)' \\
                 | ack_passthru --color-match='yellow'         '^(FOO Warning\s+::.*)' \\
                 | ack_passthru --color-match='white on_red'   '^(FOO Error)\s+::' \\
                 | ack_passthru --color-match='white on_red'   '^(FOO Fatal)\s+::' \\
                 | ack_passthru --color-match='yellow'         '^(\*WARNING\*[, ].*)' \\
                 | ack_passthru --color-match='white on_red'   '^(\*ERROR\*)' \\
                 | ack_passthru --color-match='white on_red'   '^\s*(ERROR:)' \\
                 | ack_passthru --color-match='white on_red'   '^:\s*(ERROR:.*)' \\
                 | ack_passthru --color-match='red'            '^:\s*(FAILURE:.*)' \\
                 | ack_passthru --color-match='yellow'         '^:\s*((WARNING|LIMITATION):.*)' \\
                "

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#224

Earlier quoted context omitted.

You don't need an explicit `--passthru` option. `rg '^|foo|bar|baz'` will print every line in the input while highlighting `foo`, `bar` and `baz`. I'm pretty sure the PCRE lookaround support you're referring to is exactly what the GP meant by "Perl magic powers."

Thanks. That's good to know, though it's impossible for rg to do something like this at the moment.. highlight different regexes in different colors. Note that support of \K from PCRE is really crucial for this. # Do "ack2 --help" to learn more (or "ack2 --man" to learn even more). alias ack_passthru '\ack2 -h --flush --passthru --color \!:*' # USAGE: SIM_COMMAND | hllog alias hllog "ack_passthru --color-match='white…

Huh? You can pretty much do exactly the same thing with ripgrep. There's no need for any fancy magic powers.

Example in the linux repo:

    rg --color always PM_RESUME | rg '^|PM_SUSPEND' --colors 'match:fg:green'

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#225
post #189

Earlier quoted context omitted.

You can still use xargs without overhead : > fd .py | xargs stat

Quick FYI: xargs is not the same as execdir; execdir executes the command in the same directory as the file. And to account for spaces in filenames (yay, OSX), your command starts getting a bit more complicated: fd -0 .py | xargs -0 stat

Thanks for the tips :)
Post reply on HN