Changeset 5889 for trunk/Locale-Msgfmt


Ignore:
Timestamp:
07/06/09 22:51:30 (3 years ago)
Author:
ryan52
Message:
  • unlink the output file before writing to it if it already exists
  • default to verbose (pass -q to msgfmt.pl or verbose => 0 to msgfmt)
Location:
trunk/Locale-Msgfmt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Locale-Msgfmt/Changes

    r5885 r5889  
    11Revision history for Locale-Msgfmt 
    22 
     30.12    Jul 06, 2009 
     4        - unlink the output file before writing to it if it already exists 
     5        - default to verbose (pass -q to msgfmt.pl or verbose => 0 to msgfmt) 
    36 
    470.11    Jul 06, 2009 
  • trunk/Locale-Msgfmt/bin/msgfmt.pl

    r5632 r5889  
    77use warnings; 
    88 
    9 my($opt_o, $opt_f); 
    10 GetOptions("output-file|o=s" => \$opt_o, "use-fuzzy|f" => \$opt_f); 
     9my($opt_o, $opt_f, $opt_q); 
     10GetOptions("output-file|o=s" => \$opt_o, "use-fuzzy|f" => \$opt_f, "quiet|q" => \$opt_q); 
    1111my $in = shift; 
    1212 
    13 msgfmt({in => $in, out => $opt_o, fuzzy => $opt_f}); 
     13msgfmt({in => $in, out => $opt_o, fuzzy => $opt_f, verbose => !$opt_q}); 
    1414 
    1515=head1 NAME 
  • trunk/Locale-Msgfmt/lib/Locale/Msgfmt.pm

    r5885 r5889  
    2929        die("error: input does not exist"); 
    3030    } 
     31    if ( !defined( $hash->{verbose} ) ) { 
     32        $hash->{verbose} = 1; 
     33    } 
    3134    if ( -d $hash->{in} ) { 
    3235        return _msgfmt_dir($hash); 
     
    5760    $po->parse( $hash->{in}, $mo ); 
    5861    $mo->prepare(); 
     62    unlink( $hash->{out} ) if ( -f $hash->{out} ); 
    5963    $mo->out( $hash->{out} ); 
    6064    print $hash->{in} . " -> " . $hash->{out} . "\n" if ( $hash->{verbose} ); 
Note: See TracChangeset for help on using the changeset viewer.