From 602a86093d753b48678dbcfb75f6e8cf4e05b6b1 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Wed, 1 Oct 2008 16:48:53 +0000 Subject: Add -Q (be really quiet) option to check_trans.pl CVS version numbers check_trans.pl: 1.73 -> 1.74 --- check_trans.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'check_trans.pl') diff --git a/check_trans.pl b/check_trans.pl index c46017b0323..3e04d9fc668 100755 --- a/check_trans.pl +++ b/check_trans.pl @@ -37,6 +37,7 @@ # $ check_trans.pl -s devel italian # # Options: +# -Q be really quiet (only show errors/warnings on stderr) # -q just don't whine about missing files # -v show the status of all files (verbose) # -V output what we're doing (very verbose) @@ -749,7 +750,7 @@ sub parse_cmdargs $OPT{s} = ''; # parse options - if ( not getopts( 'adghm:n:p:qs:TvV', \%OPT ) ) + if ( not getopts( 'adghm:n:p:Qqs:TvV', \%OPT ) ) { show_help(); exit -1; @@ -763,13 +764,22 @@ sub parse_cmdargs } # handle verbosity setting - if ( ( $OPT{'v'} or $OPT{'V'} ) and $OPT{'Q'} ) + if ( ( $OPT{'v'} or $OPT{'V'} ) and ( $OPT{'q'} or $OPT{'Q'} ) ) { die "you can't have both verbose and quiet, doh!\n"; } $VERBOSE = 1 if $OPT{'V'}; $OPT{'v'} = 1 if $OPT{'V'}; + # handle really quiet setting + if ( $OPT{'Q'} ) + { + # redirect stdout to /dev/null + close( STDOUT ); + open( STDOUT, '>', '/dev/null' ) + or die( "Can't redirect STDOUT to /dev/null: $!" ); + } + # handle -s (subtree check) setting if ( $OPT{s}) { -- cgit v1.2.3