From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753354AbcGDKo2 (ORCPT ); Mon, 4 Jul 2016 06:44:28 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33933 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752759AbcGDKo1 (ORCPT ); Mon, 4 Jul 2016 06:44:27 -0400 Date: Mon, 4 Jul 2016 12:44:03 +0200 From: Valentin Rothberg To: Andrew Donnellan Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Subject: Re: [PATCH] checkkconfigsymbols.py: add --no-color option Message-ID: <20160704104403.qe74rkyt6ix3nqrk@susevm> References: <1467621570-970-1-git-send-email-andrew.donnellan@au1.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1467621570-970-1-git-send-email-andrew.donnellan@au1.ibm.com> User-Agent: Mutt/1.6.1-neo (2016-06-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, thanks for your patch. Please remove the colour comment from the commit message and resend the patch. Such comments are better below the '---'. On Jul 04 '16 18:39, Andrew Donnellan wrote: > Add a new option, --no-color, to get rid of ANSI colour escape codes in the > output. Useful if redirecting output to a file or piping to another script. > > (It should really be --no-colour, but I'll accept US spelling in the name > of consistency with existing usage in the code comments...) > > Signed-off-by: Andrew Donnellan Acked-by: Valentin Rothberg Thanks, Valentin > --- > scripts/checkkconfigsymbols.py | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py > index df643f6..a9eba02 100755 > --- a/scripts/checkkconfigsymbols.py > +++ b/scripts/checkkconfigsymbols.py > @@ -82,6 +82,10 @@ def parse_options(): > default=False, > help="Reset current Git tree even when it's dirty.") > > + parser.add_option('', '--no-color', dest='no_color', action='store_true', > + default=False, > + help="Don't print colored output.") > + > (opts, _) = parser.parse_args() > > if opts.commit and opts.diff: > @@ -116,6 +120,9 @@ def main(): > """Main function of this module.""" > opts = parse_options() > > + global no_color > + no_color = opts.no_color > + > if opts.sim and not opts.commit and not opts.diff: > sims = find_sims(opts.sim, opts.ignore) > if sims: > @@ -202,14 +209,14 @@ def yel(string): > """ > Color %string yellow. > """ > - return "\033[33m%s\033[0m" % string > + return string if no_color else "\033[33m%s\033[0m" % string > > > def red(string): > """ > Color %string red. > """ > - return "\033[31m%s\033[0m" % string > + return string if no_color else "\033[31m%s\033[0m" % string > > > def execute(cmd): > -- > Andrew Donnellan OzLabs, ADL Canberra > andrew.donnellan@au1.ibm.com IBM Australia Limited >