Merge pull request #399 from tculp/case-insensitive-search

Changed search behavior to lower the search term and the lines being …
This commit is contained in:
Chris Allen Lane 2018-10-15 10:44:57 -04:00 committed by GitHub
commit 500dbbbd4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,11 +79,12 @@ def list():
def search(term):
""" Searches all cheatsheets for the specified term """
result = ''
lowered_term = term.lower()
for cheatsheet in sorted(get().items()):
match = ''
for line in open(cheatsheet[1]):
if term in line:
if lowered_term in line:
match += ' ' + line
if match != '':