Changed search behavior to lower the search term and the lines being searched, thus providing case-insensitive search
This commit is contained in:
1 parent
03fb44159a
commit
4b6dc22c0a
1 file changed
+2
-1
+2
-1
@@ -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 != '':
|
||||
|
||||
Reference in new issue
Block a user