From 5fcbe92eed58f42e6de4e7760b68d926e2104415 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Sat, 4 Oct 2008 19:58:47 +0000 Subject: Add option -c to disable colours in the output CVS version numbers check_trans.pl: 1.81 -> 1.82 --- check_trans.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'check_trans.pl') diff --git a/check_trans.pl b/check_trans.pl index 3d0c99f48cd..3ffb20d1339 100755 --- a/check_trans.pl +++ b/check_trans.pl @@ -23,7 +23,7 @@ # # # Invocation: -# check_trans.pl [-dlvqQ] [-C dir] [-p pattern] [-s subtree] +# check_trans.pl [-cdlvqQ] [-C dir] [-p pattern] [-s subtree] # [-m email -n N] [-c charset] [-g] [-t outputtype] # [language] # @@ -48,6 +48,7 @@ # default is *.src|*.wml # -s check only that subtree # -a output age of translation (if older than 2 months) +# -c disable use of color in the output # # Options useful when sending mails: # -m sends mails to translation maintainers @@ -773,7 +774,7 @@ sub parse_cmdargs $OPT{s} = ''; # parse options - if ( not getopts( 'adghlm:n:p:Qqs:TvV', \%OPT ) ) + if ( not getopts( 'acdghlm:n:p:Qqs:TvV', \%OPT ) ) { show_help(); exit -1; @@ -803,6 +804,13 @@ sub parse_cmdargs or die( "Can't redirect STDOUT to /dev/null: $!" ); } + # handle -c (disable color) setting + if ( $OPT{'c'} ) + { + # nice feature of Term::ANSIColor + $ENV{'ANSI_COLORS_DISABLED'} = '1'; + } + # handle -s (subtree check) setting if ( $OPT{s}) { -- cgit v1.2.3