hightlight the search keywords

This commit is contained in:
sunyakun 2017-10-12 09:25:20 +08:00
parent cdf573a725
commit 761bf2eb2f
1 changed files with 2 additions and 0 deletions

View File

@ -84,6 +84,8 @@ def search(term):
match = ''
for line in open(cheatsheet[1]):
if term in line:
if 'CHEATCOLORS' in os.environ:
line = line.replace(term, '\033[1;31m' + term + '\033[0m');
match += ' ' + line
if match != '':