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

prints files and numbers like './build.md:70' #228

Closed
wants to merge 1 commit into from

Conversation

CarlQLange
Copy link

I wanted to be able to list files and numbers of matches so I could do a checklist-type-thing. So now, when you do ag -N "myMatch", (or ag --files-and-numbers "myMatch") it prints out a list of matching files like

file1.cpp:42
file1.cpp:57

file2.cpp:29

and you can use it with --nobreak to get rid of the newlines if you don't like them. It has coloured and uncoloured output and stuff too. 💛

By the way, great code! Haven't written C in a long time, the source was very legible and extensible. Let me know if I missed or broke anything!

@@ -308,6 +310,9 @@ void parse_options(int argc, char **argv, char **base_paths[], char **paths[]) {
case 'n':
opts.recurse_dirs = 0;
break;
case 'N':

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @CarlQLange,

I think you are using literal tabs rather than spaces - it breaks the indenting, as you can see here:
https://github.com/CarlQLange/the_silver_searcher/blob/88ed0a429a0feb894e92cbe8e5b51d39a0b51c93/src/options.c#L310-L318

(I randomly stumbled across Ag and was looking at outstanding pull requests)

@CarlQLange
Copy link
Author

Ah, whoops - I will fix and commit later. I never remember to check whitespace when committing to other projects. Thanks a lot for your input, @samjsharpe :)

@CarlQLange
Copy link
Author

closing since I never got around to this and it's many many years later :)

@CarlQLange CarlQLange closed this Nov 21, 2017
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.

2 participants