beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 140 forks source link

Option '--type-set' not working correctly. #389

Closed ericsubach closed 7 years ago

ericsubach commented 11 years ago

According to the manual, --type-set is the way to add a new type; --type-add is only for adding to an existing type. However, it seems that only --type-add will work.

Example

.ackrc

--type-set=simple:ext:smpl
--nosimple

Steps

  1. echo 'this should work' > test.smpl
  2. ack --simple work. Expected output, but never got any.
  3. Changing the --type-set to a type-add fixes the problem.

    Info

Ack version 2.10, tested on both linux mint 32-bit and Windows 64-bit strawberry perl (64-bit). Everything is default except the shown .ackrc.

concretevitamin commented 11 years ago

I think the following issue is perhaps related to this issue, so I am commenting here:

ack 2.10 has defined --rr which is for .R files. If I use

--type-set=r=.R

in my own .ackrc, then "ack --r" will NOT return any expected results. Removing this line and using "ack --rr" work.

Please at least document this behavior (if not a bug) somewhere.

petdance commented 11 years ago

We need to document that you can't have types shorter than two characters.

You say it "will NOT return any expected results." What does it do?

concretevitamin commented 11 years ago

That makes sense. FWIW, it returned nothing and reported nothing, in my case.

petdance commented 7 years ago

This will go out in 2.17_02. Thanks.