diff options
author | Valentin Rothberg <valentinrothberg@gmail.com> | 2015-06-01 10:00:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-03 20:16:58 -0400 |
commit | c745566306e363675d8aa43ee9f39232ade4d5e6 (patch) | |
tree | 9adcccac5edff26713bc059b5b9ed2f67a01b9f5 /scripts/checkkconfigsymbols.py | |
parent | a42fa92ce77a9181f9baf57655acbb241ac4d306 (diff) |
checkkconfigsymbols.py: colored output
Color output to make it more readable. Symbols will be printed yellow,
relevant commits (see --find) red.
Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Acked-by: Stefan Hengelein <stefan.hengelein@fau.de>
Acked-by: Andreas Ruprecht <andreas.ruprecht@fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/checkkconfigsymbols.py')
-rwxr-xr-x | scripts/checkkconfigsymbols.py | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py index 292848e32036..d89371cc9110 100755 --- a/scripts/checkkconfigsymbols.py +++ b/scripts/checkkconfigsymbols.py | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | """Find Kconfig symbols that are referenced but not defined.""" | 3 | """Find Kconfig symbols that are referenced but not defined.""" |
4 | 4 | ||
5 | # (c) 2014-2015 Valentin Rothberg <Valentin.Rothberg@lip6.fr> | 5 | # (c) 2014-2015 Valentin Rothberg <valentinrothberg@gmail.com> |
6 | # (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de> | 6 | # (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de> |
7 | # | 7 | # |
8 | # Licensed under the terms of the GNU GPL License version 2 | 8 | # Licensed under the terms of the GNU GPL License version 2 |
@@ -136,19 +136,19 @@ def main(): | |||
136 | # feature has not been undefined before | 136 | # feature has not been undefined before |
137 | if not feature in undefined_a: | 137 | if not feature in undefined_a: |
138 | files = sorted(undefined_b.get(feature)) | 138 | files = sorted(undefined_b.get(feature)) |
139 | print "%s\t%s" % (feature, ", ".join(files)) | 139 | print "%s\t%s" % (yel(feature), ", ".join(files)) |
140 | if opts.find: | 140 | if opts.find: |
141 | commits = find_commits(feature, opts.diff) | 141 | commits = find_commits(feature, opts.diff) |
142 | print commits | 142 | print red(commits) |
143 | # check if there are new files that reference the undefined feature | 143 | # check if there are new files that reference the undefined feature |
144 | else: | 144 | else: |
145 | files = sorted(undefined_b.get(feature) - | 145 | files = sorted(undefined_b.get(feature) - |
146 | undefined_a.get(feature)) | 146 | undefined_a.get(feature)) |
147 | if files: | 147 | if files: |
148 | print "%s\t%s" % (feature, ", ".join(files)) | 148 | print "%s\t%s" % (yel(feature), ", ".join(files)) |
149 | if opts.find: | 149 | if opts.find: |
150 | commits = find_commits(feature, opts.diff) | 150 | commits = find_commits(feature, opts.diff) |
151 | print commits | 151 | print red(commits) |
152 | 152 | ||
153 | # reset to head | 153 | # reset to head |
154 | execute("git reset --hard %s" % head) | 154 | execute("git reset --hard %s" % head) |
@@ -158,7 +158,21 @@ def main(): | |||
158 | undefined = check_symbols(opts.ignore) | 158 | undefined = check_symbols(opts.ignore) |
159 | for feature in sorted(undefined): | 159 | for feature in sorted(undefined): |
160 | files = sorted(undefined.get(feature)) | 160 | files = sorted(undefined.get(feature)) |
161 | print "%s\t%s" % (feature, ", ".join(files)) | 161 | print "%s\t%s" % (yel(feature), ", ".join(files)) |
162 | |||
163 | |||
164 | def yel(string): | ||
165 | """ | ||
166 | Color %string yellow. | ||
167 | """ | ||
168 | return "\033[33m%s\033[0m" % string | ||
169 | |||
170 | |||
171 | def red(string): | ||
172 | """ | ||
173 | Color %string red. | ||
174 | """ | ||
175 | return "\033[31m%s\033[0m" % string | ||
162 | 176 | ||
163 | 177 | ||
164 | def execute(cmd): | 178 | def execute(cmd): |