Add support for negation of -k --known-types options
Implementation of feature request in issue https://github.com/petdance/ack2/issues/293.
Awesome work @packy! This looks mostly good to me, only a few issues:
- Could you rebase your work on top of current dev and get rid of the merge commit?
- I think we've discusssed this before, but is
--no-known-typesthe best name for the switch? Maybe--not-only-known-types, but that might be needlessly verbose... - In your patch you blow away
$opt->{filters}; have you seen any issues combining--no-known-typeswith--type=perl,--notype=perl, and such? Combining with--type=perlseems silly, but--notype=perlmight make some sense.
I think it needs to follow the convention of --no-xxxx and be --no-known-types.
It was rebased on top of current dev, but I figured out how to get rid of the merge commit.
And I took the name --no-known-types from Andy's suggestion in issue https://github.com/petdance/ack2/issues/293.
I hadn't tried combining it with --type=noperl, so I just did:
-
ack -K --type=noperl foosearches for 'foo' in all files except perl files -
ack --type=noperl -K foosearches for 'foo' in all files
Which is pretty much what I'd expect it to do: negate all type filtering that had been specified up to that point.
Remember, this is mostly a way for users to turn off a --known-types that was set in their .ackrc on a case-by-case basis.
@packy Right, I just wanted to make sure that the behavior followed expectations. =) Everything looks good to me; should I merge @petdance?
On Apr 15, 2014, at 2:02 PM, Rob Hoelz [email protected] wrote:
@packy Right, I just wanted to make sure that the behavior followed expectations. =) Everything looks good to me; should I merge @petdance?
I haven't even looked at it yet. See comment from earlier this morning.