mirror of https://github.com/cheat/cheat.git
hightlight the search keywords
This commit is contained in:
parent
cdf573a725
commit
761bf2eb2f
|
@ -84,6 +84,8 @@ def search(term):
|
||||||
match = ''
|
match = ''
|
||||||
for line in open(cheatsheet[1]):
|
for line in open(cheatsheet[1]):
|
||||||
if term in line:
|
if term in line:
|
||||||
|
if 'CHEATCOLORS' in os.environ:
|
||||||
|
line = line.replace(term, '\033[1;31m' + term + '\033[0m');
|
||||||
match += ' ' + line
|
match += ' ' + line
|
||||||
|
|
||||||
if match != '':
|
if match != '':
|
||||||
|
|
Loading…
Reference in New Issue