option: Add option to limit result list #187
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
I got tons of results and would like to have fewer so the output doesn't autoscroll to the worst (maybe?) results.
example of what I did:
This auto-scrolled to the bottom which only has kinda horrible results. I'd like to just see the first 50 or 10 for example.
My change
I added another option:
-n
or--max-results
which is set like:and if you set it to 1, it will just open the top result immediately.
Testing
I only tested this via python bin/cppman fuzzyterm -n/--max-results 1/10/15/100. I saw that as sufficient, but you know better so I can do more tests if you believe it needs it.
What I didn't do
I am only making this fork->change->PR and haven't made any updates changelog or contributor list. Also did nothing regarding making an executable from the python code, so that may not work? I am not sure how you do that part in this project :)