diff --git a/mtbp3/health/ectd.py b/mtbp3/health/ectd.py index 2e91b199..7792d0e2 100644 --- a/mtbp3/health/ectd.py +++ b/mtbp3/health/ectd.py @@ -59,6 +59,14 @@ def find_section_given_words(self, words, outfmt='simple', include='up', to_righ raise ValueError("Invalid value for include. Supported values are 'up' and 'both'.") out = [row for row in self.ctoc if any(word.lower() in row.lower() for word in words)] + out_colored = [] + for row in out: + for word in words: + start = row.lower().index(word.lower()) + end = start + len(word) + row = row[:start] + f"\033[91m{row[start:end]}\033[0m" + row[end:] + out_colored.append(row) + out = out_colored if outfmt == 'simple': return out elif outfmt == 'tree':