What Andy said.
Longer form --
The reason *** will find a file that *.* doesn't is that Ack's concept
of *interesting
vs ignorable* files is set aside *if* a specific *file* or *list of files*
is provided,
and since * is interpreted by the shell, Ack sees a specific list of files.
Meaning that `*ack --type=js *`* will NOT limit to just js !! ;
the user is trusted to have typed *.js if that's what they meant, and the
conflicting --type is ignored. (*and arguably should give a warning*?)
When given a starting *directory*, it still uses its idea of ^*interesting*
^.
Hence * is different from . for Ack .
(* is different from . for grep also: in that hidden .files aren't expanded
by the shell's * , but ack and `*grep -r* `will look at them from *./* .)
Minimized JavaScript (*.min.js) is generally thought to be *unreadable*; as
you say, *very* long lines!,
so in the default state,* *.min.js *is not considered interesting.
Even if you type* --type=js .*
(We have received a request ticket to allow windowing of *.min.js long
lines ...
but without that, it's usable only with the* -l *flag, as you did!
Warning: ack checkboxClass *.js will match *.min.js as well as nice *.js,
since it expands by shell, and thus dump the long lines. But that's not
recursive.)
How is this done?
The default config (from $wherever/lib/App/Ack/ConfigDefault.pm and as seen
in Andy's *ack --dump *output ) includes
*--ignore-file=match:/[.-]min[.]js$/*
*Workaround(s) -*
Aside from using ** ,* or *ack -l ${pattern} *.min.js*, or -l *.js, you
can override all the defaults seen in *ack --dump *by
*--ignore-ack-defaults*
which is even stronger than *--noenv *(which ignores global ackrc as well
as any ENV vars)
but that guts out *all *of the* --type *definitions plus other stuff in
--dump.
( so you wouldn't want to put that in a ./.ackrc *unless* you saved ack
--dump >> .ackrc and deleted what you didn't like.)
Alas i don't know of a way to *cancel* built-in or prior ackrc/env
--ignore-{dir,file}= directives without purging everything with
--ignore-ack-defaults ?
But when you need to find minimized JS, it's there for you.
If you want to scan only the minimized js, but recursively,
*ack -g 'min[.]js$' --ignore-ack-defaults | ack -x -l checkboxClass*
will do.
*DIAGNOSTICS*
You can see what files Ack *would* look at with a given * or . or
${directory} argument, and what Types they're considered, by
*ack -f --show-types ${options} ${paths}*
try path = . or * or a short list; try options = " ", " *--type=js " *or*
" --ignore-ack-defaults "*
Note that *--type=js ** is a useless combination.
If you try both *--type=js --ignore-ack-defaults*
you'll find that *js *is undefined with defaults ignored, all will be
considered.
--
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/CAAbKA3WRqRMFEfbYjb0mr6yGFRDOtgPefFiduDa%2BqgPojMR8ug%40mail.gmail.com.