> I've tried adding types using all of the commands that I've found into to 
> documentation and all over the Internet. Unfortunately I'm always the getting 
> the same error: " No regular expression found."
> 
> For example:
> konrad@Konrads-MacBook-Pro Users % ack --type-set=cypress:ext:ts
> ack: No regular expression found.

When you specify a type on the command line, you still have to specify the rest 
of the things to search. It's not a permanent addition.  So you could do:

   ack --type-set=cypress:ext:ts --cypress pattern

and it would search only the cypress files for the pattern.

If you want cypress available always (which is probably the case), you add that 
--type-set to an .ackrc file.  It could be your own personal ~/.ackrc file, or 
it could be a project-specific one.

For more about setting types in your .ackrc file, see the ack manual ("ack 
--man") and then find the section called "The .ackrc file" and "Defining your 
own types".

You can put types and other handy things in your .ackrc file.  Here's what mine 
looks like:

$ cat .ackrc
--sort-files
--smart-case
--type-add=pytest:match:_test[.]py$
--type-add=pytest:match:^test_.*[.]py$
--type-add=jenkins:is:Jenkinsfile

I always want the files sorted, I always want to use --smart-case, and I have 
definitions for pytest and jenkins files.

Does that help?

Andy

-- 
You received this message because you are subscribed to the Google Groups "ack 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ack-users/B4CE54D0-B8C2-4255-919A-B94DDEBF91B6%40petdance.com.

Reply via email to