Associating extend extension with ack filetype

16 views
Skip to first unread message

V S

unread,
Mar 15, 2022, 4:36:20 PM3/15/22
to ack users
Hi Forum

I am looking to associate an extended extension with a filetype in ack as -

--type-set=rtljinja=v.jj,sv.jj

Notice my extensions have two dot separated fields as -
v.jj and sv.jj

This does not seem to work.
Is this not supported in ack?

Thanks

Andy Lester

unread,
Mar 15, 2022, 4:45:06 PM3/15/22
to ack-...@googlegroups.com

Notice my extensions have two dot separated fields as -
v.jj and sv.jj

This does not seem to work.
Is this not supported in ack?


Not as extensions.  Ack only sees the last .whatever as the extension.  You’ll have to use a different way of specifying it, by using the “match” type and specifying a regex to match against the filename.

--type-set=rtljinja:match:[.]v[.]jj$
--type-set=rtljinja:match:[.]sv[.]jj$

Or you can combine those two regexes together: 

--type-set=rtljinja:match:[.]s?v[.]jj$

To see more examples, run “ack —dump” which shows you all the specs for the defaults that ack ships with.

Andy

V S

unread,
Mar 16, 2022, 1:12:40 AM3/16/22
to ack users
Thanks Andy,
Tried your solution ..

Use of uninitialized value $ext in split at /org/seg/tools/eda/freeware/ack/1.96/ack line 1533.
Error in option spec: "rtljinja:match:[.]v[.]jj$!"

Andy Lester

unread,
Mar 16, 2022, 9:55:19 AM3/16/22
to ack-...@googlegroups.com
Use of uninitialized value $ext in split at /org/seg/tools/eda/freeware/ack/1.96/ack line 1533.
Error in option spec: "rtljinja:match:[.]v[.]jj$!”

You’ll need a newer version of ack.  Your version of ack is over a decade old. The latest is 3.5.0.  You can get it from https://beyondgrep.com/

Andy

Reply all
Reply to author
Forward
0 new messages