From 7fe5ff79056ae0cf19f89d5704319f13d2144adc Mon Sep 17 00:00:00 2001 From: Tyler Culp Date: Thu, 20 Sep 2018 13:43:35 -0400 Subject: [PATCH] Changed search behavior to lower the search term and the lines being searched, thus providing case-insensitive search --- cheat/sheets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cheat/sheets.py b/cheat/sheets.py index 1a0b28e..6f5d99f 100644 --- a/cheat/sheets.py +++ b/cheat/sheets.py @@ -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 != '':