Patch to match shebang lines with version numbers

12 views
Skip to first unread message

truist

unread,
Sep 16, 2011, 5:51:50 PM9/16/11
to ack dev/users
Hello,

At my work, we use explicit version numbers in our shebang lines (for
perl). Example:

#!/some/path/perl5.8.8

('perl5.8.8' is an actual perl binary)

When the files containing this shebang line don't have an extension,
the regex in filetypes() won't match the shebang line, so these files
are (silently) not searched. (Took us a while to figure this out.)

I propose the following change to that regex:

return ($1,TEXT) if $header =~ /\b(ruby|p(?:erl|hp|ython))[\d\.
\_]*\b/;

Sorry this isn't a patch against the original source. If it's really
necessary, I'll go chase down the code on github and figure out where
it should go and submit one... eventually :)

Nathan

Andy Lester

unread,
Sep 16, 2011, 5:56:37 PM9/16/11
to ack-...@googlegroups.com

On Sep 16, 2011, at 4:51 PM, truist wrote:

At my work, we use explicit version numbers in our shebang lines (for
perl).  Example:

We will have more flexibility in ack 2.0.  I'm not going to be making changes in ack 1.x for this, though.  For now, I suggest you patch your ack executable.

Thanks,
xoxo,
Andy


truist

unread,
Sep 16, 2011, 6:02:07 PM9/16/11
to ack dev/users
> We will have more flexibility in ack 2.0.  I'm not going to be making changes in ack 1.x for this, though.  For now, I suggest you patch your ack executable.

Done already :) Thanks, we'll watch for 2.0.

Reply all
Reply to author
Forward
0 new messages