| 37 |
# $ check_trans.pl -s devel italian |
# $ check_trans.pl -s devel italian |
| 38 |
# |
# |
| 39 |
# Options: |
# Options: |
| 40 |
|
# -Q be really quiet (only show errors/warnings on stderr) |
| 41 |
# -q just don't whine about missing files |
# -q just don't whine about missing files |
| 42 |
# -v show the status of all files (verbose) |
# -v show the status of all files (verbose) |
| 43 |
# -V output what we're doing (very verbose) |
# -V output what we're doing (very verbose) |
| 750 |
$OPT{s} = ''; |
$OPT{s} = ''; |
| 751 |
|
|
| 752 |
# parse options |
# parse options |
| 753 |
if ( not getopts( 'adghm:n:p:qs:TvV', \%OPT ) ) |
if ( not getopts( 'adghm:n:p:Qqs:TvV', \%OPT ) ) |
| 754 |
{ |
{ |
| 755 |
show_help(); |
show_help(); |
| 756 |
exit -1; |
exit -1; |
| 764 |
} |
} |
| 765 |
|
|
| 766 |
# handle verbosity setting |
# handle verbosity setting |
| 767 |
if ( ( $OPT{'v'} or $OPT{'V'} ) and $OPT{'Q'} ) |
if ( ( $OPT{'v'} or $OPT{'V'} ) and ( $OPT{'q'} or $OPT{'Q'} ) ) |
| 768 |
{ |
{ |
| 769 |
die "you can't have both verbose and quiet, doh!\n"; |
die "you can't have both verbose and quiet, doh!\n"; |
| 770 |
} |
} |
| 771 |
$VERBOSE = 1 if $OPT{'V'}; |
$VERBOSE = 1 if $OPT{'V'}; |
| 772 |
$OPT{'v'} = 1 if $OPT{'V'}; |
$OPT{'v'} = 1 if $OPT{'V'}; |
| 773 |
|
|
| 774 |
|
# handle really quiet setting |
| 775 |
|
if ( $OPT{'Q'} ) |
| 776 |
|
{ |
| 777 |
|
# redirect stdout to /dev/null |
| 778 |
|
close( STDOUT ); |
| 779 |
|
open( STDOUT, '>', '/dev/null' ) |
| 780 |
|
or die( "Can't redirect STDOUT to /dev/null: $!" ); |
| 781 |
|
} |
| 782 |
|
|
| 783 |
# handle -s (subtree check) setting |
# handle -s (subtree check) setting |
| 784 |
if ( $OPT{s}) |
if ( $OPT{s}) |
| 785 |
{ |
{ |