Changed search behavior to lower the search term and the lines being searched, thus providing case-insensitive search

This commit is contained in:
Tyler Culp 2018-09-20 13:43:35 -04:00
parent 334040ee07
commit 7fe5ff7905

View File

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