fix bugs when searching for multiple words or for spaces #36
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.
This is an extension of #32
Examples contain output from running spot inside its repository directory.
The change on line 121 is required to suppress an error message printed when searching for multiple words:
On line 163, replacing
"$@"
with"`echo $@`"
is required for multiple word search to work properly:On that line, adding quotation marks around the
$@
in the echo is required to make searching for an empty string to work:Finally, this fixes an error when trying to search for slashes:
On line 113, the '//' search term is detected as a directory (at least on bash, '//', '///', etc. are interpreted as just '/' and so pass the
-d
test on line 114). The additional regex test on 113 verifies that there is at least one non-'/' character before counting it as a manually-specified search directory. The only issue is that this makes it impossible to do a search on the entire filesystem by doingspot / searchTerm
- the '/' is not detected as a directory since it does not contain a non-'/' character. The two workarounds are to either:cd /; spot ./ searchTerm