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

Added -x/--line-regexp (match whole line) option #625

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added -x/--line-regexp (match whole line) option #625

wants to merge 1 commit into from

Conversation

okdana
Copy link
Contributor

@okdana okdana commented Mar 7, 2015

ag already has the -w option, and this seems a fairly obvious complement to it, so i'm worried that this was requested and rejected at some point in the past. However, i can't find anything in the list of issues to confirm that so... here we go.

Just in case it's not super clear, -x is an option described in the POSIX specification for grep which causes the pattern to match on whole lines only. In other words, grep -x 'foo' has the same effect as grep '^foo$'.

This is an option that i miss a lot when using ag, so i thought i'd try to add it. Sorry if it's shit, this is only like the second time i've really done anything in C. I also added some cram tests for both this option and the existing -w.

Added -x/--line-regexp (match whole line) option
- Added -x functionality (like `grep`) for literal and non-literal matching
- Options -w and -x are mutually exclusive
- Added cram tests for -w and -x options

- Added -x functionality (like `grep`) for literal and non-literal matching
- Options -w and -x are mutually exclusive
- Added cram tests for -w and -x options
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

Successfully merging this pull request may close these issues.

None yet

1 participant