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.
What does it do?
Improves
complete.bash
by:_tldr_get_files()
, which does nothing but re-echo
es the same output.| sort | uniq
calls._tldr_get_files()
now only returns the matching results, instead of returning thousands of lines each time.--vers
, which it should autocomplete. This version would autocomplete in that case totldr --version
.--verbose
); this version adds them.Why the change?
The autocomplete function almost freezes (on my system) for almost 20 secs (I am using it in bash). This is due to the above reasons. This version reduces that time to almost instantaneous.
How can this be tested?
Install the autocomplete file just as is described in this repo's
README.md
, and try to use completion (with tab key press) in bash.Where to start code review?
I've already mentioned the major changes in the What does it do? section.
Questions?
N/A
Checklist
make
and tested the change in an active installation withsudo make install
.Notes for (2) : Since this is not a change in the code for the actual
tldr
program, I have not run (2); but rather tested the change with the steps I mentioned in How can this be tested? section.