Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753229AbbFAOBG (ORCPT ); Mon, 1 Jun 2015 10:01:06 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:36155 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752970AbbFAOAy (ORCPT ); Mon, 1 Jun 2015 10:00:54 -0400 From: Valentin Rothberg To: gregkh@linuxfoundation.org, stefan.hengelein@fau.de, andreas.ruprecht@fau.de, pebolle@tiscali.nl Cc: linux-kernel@vger.kernel.org, Valentin Rothberg Subject: [PATCH 2/2] checkkconfigsymbols.py: colored output Date: Mon, 1 Jun 2015 16:00:20 +0200 Message-Id: <1433167220-12292-3-git-send-email-valentinrothberg@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433167220-12292-1-git-send-email-valentinrothberg@gmail.com> References: <1433167220-12292-1-git-send-email-valentinrothberg@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2835 Lines: 78 Color output to make it more readable. Symbols will be printed yellow, relevant commits (see --find) red. Signed-off-by: Valentin Rothberg Acked-by: Stefan Hengelein Acked-by: Andreas Ruprecht --- scripts/checkkconfigsymbols.py | 26 ++++++++++++++++++++------ 1 file 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 @@ """Find Kconfig symbols that are referenced but not defined.""" -# (c) 2014-2015 Valentin Rothberg +# (c) 2014-2015 Valentin Rothberg # (c) 2014 Stefan Hengelein # # Licensed under the terms of the GNU GPL License version 2 @@ -136,19 +136,19 @@ def main(): # feature has not been undefined before if not feature in undefined_a: files = sorted(undefined_b.get(feature)) - print "%s\t%s" % (feature, ", ".join(files)) + print "%s\t%s" % (yel(feature), ", ".join(files)) if opts.find: commits = find_commits(feature, opts.diff) - print commits + print red(commits) # check if there are new files that reference the undefined feature else: files = sorted(undefined_b.get(feature) - undefined_a.get(feature)) if files: - print "%s\t%s" % (feature, ", ".join(files)) + print "%s\t%s" % (yel(feature), ", ".join(files)) if opts.find: commits = find_commits(feature, opts.diff) - print commits + print red(commits) # reset to head execute("git reset --hard %s" % head) @@ -158,7 +158,21 @@ def main(): undefined = check_symbols(opts.ignore) for feature in sorted(undefined): files = sorted(undefined.get(feature)) - print "%s\t%s" % (feature, ", ".join(files)) + print "%s\t%s" % (yel(feature), ", ".join(files)) + + +def yel(string): + """ + Color %string yellow. + """ + return "\033[33m%s\033[0m" % string + + +def red(string): + """ + Color %string red. + """ + return "\033[31m%s\033[0m" % string def execute(cmd): -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/