diff options
author | Bas Zoetekouw <bas> | 2008-10-04 19:58:47 +0000 |
---|---|---|
committer | Bas Zoetekouw <bas> | 2008-10-04 19:58:47 +0000 |
commit | 5fcbe92eed58f42e6de4e7760b68d926e2104415 (patch) | |
tree | ff4ee9b0c8a1be6f9ae879bef5d6d94b6c907d8f /check_trans.pl | |
parent | 63cb7838fb3f021e74c9774b1b89f0536bf5c169 (diff) |
Add option -c to disable colours in the output
CVS version numbers
check_trans.pl: 1.81 -> 1.82
Diffstat (limited to 'check_trans.pl')
-rwxr-xr-x | check_trans.pl | 12 |
1 files changed, 10 insertions, 2 deletions
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 <subtree> 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 <email> 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}) { |