Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] If both -a and --ignore-dir are specified on command line, please respect the --ignore-dir argument(s) #1546

Open
jolsen-mitsu opened this issue Nov 22, 2024 · 0 comments

Comments

@jolsen-mitsu
Copy link

Right now, if -a is specified, then ag appears to ignore the --ignore-dir argument(s).

Please update ag so that if both -a and --ignore-dir are used as command line arguments, the --ignore-dir argument(s) are respected and those directories are ignored.

Use case: by default, ag ignores a number of file types and directories by default, which usually is perfect. Sometimes I need to search for something that is in one of those excluded file types, so I need to use the -a option. I work with both node/Angular and Python virtual environments, and what I'm searching for often appears tens to hundreds of times within these directories, giving me a poor signal-to-noise ratio in the search results. I want to be able to exclude the venv and node_modules and .angular directories by using one or more --ignore-dir arguments. But right now, --ignore-dir arguments are ignored if -a has been specified.

For example if I execute:
ag -a --ignore-dir venv xyz
Ag currently searches the venv directory for xyz instead of ignoring venv. I am requesting ag be updated to always respect --ignore-dir arguments, regardless if -a has been specified or not. Or, if this will have unintended side effects with the use of -a argument, then some new argument/switch to search all files but still respect --ignore-dir argument(s).

Ag is an incredibly helpful utility, and this functionality will make it even more helpful.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant