diff options
author | Bas Zoetekouw <bas> | 2008-10-01 16:48:53 +0000 |
---|---|---|
committer | Bas Zoetekouw <bas> | 2008-10-01 16:48:53 +0000 |
commit | 602a86093d753b48678dbcfb75f6e8cf4e05b6b1 (patch) | |
tree | f6188e0efef3fd5d5ddebccb3337ab925c9ae458 | |
parent | dac3ae57d985d143b82d9a79c97dc9e89500428d (diff) |
Add -Q (be really quiet) option to check_trans.pl
CVS version numbers
check_trans.pl: 1.73 -> 1.74
-rwxr-xr-x | check_trans.pl | 14 |
1 files changed, 12 insertions, 2 deletions
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}) { |