Changeset 10615 for trunk/Padre/dev.pl


Ignore:
Timestamp:
02/08/10 02:23:11 (2 years ago)
Author:
adamk
Message:

Added support for --reset to flush and reset the configuration to defaults, because the Swarm plugin is instantly segfaulting Padre at startup and I didn't want to have to keep resetting the configuration by hand all the time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/dev.pl

    r10519 r10615  
    1515use Getopt::Long (); 
    1616use vars qw{ 
     17    $USAGE 
    1718    $DEBUG 
    18     $TRACE 
    19     $DIE 
    2019    $PROFILE 
    2120    $PLUGINS 
    22     $USAGE 
    2321    $FULLTRACE 
    2422    $INVISIBLE 
     
    2725 
    2826BEGIN { 
     27    $USAGE     = 0; 
    2928    $DEBUG     = 0; 
    30     $DIE       = 0; 
    3129    $PROFILE   = 0; 
    3230    $PLUGINS   = 0; 
    33     $USAGE     = 0; 
    3431    $FULLTRACE = 0; 
    3532    $INVISIBLE = 0; 
    3633    @INCLUDE   = (); 
    3734    Getopt::Long::GetOptions( 
    38         'usage|help' => \$USAGE, 
    39         'debug|d'    => \$DEBUG, 
    40         'trace'      => sub { 
    41             $ENV{PADRE_DEBUG} = 1; 
    42         }, 
    43         'die'         => \$DIE, 
     35        'usage|help'  => \$USAGE, 
     36        'debug|d'     => \$DEBUG, 
     37        'trace'       => sub { $ENV{PADRE_DEBUG} = 1 }, 
     38        'die'         => sub { $ENV{PADRE_DIE}   = 1 }, 
    4439        'profile'     => \$PROFILE, 
    4540        'a'           => \$PLUGINS, 
     
    5045} 
    5146 
    52 $USAGE and usage(); 
    53  
    5447$ENV{PADRE_DEV}  = 1; 
    5548$ENV{PADRE_HOME} = $FindBin::Bin; 
    56 $ENV{PADRE_DIE}  = $DIE; 
    5749 
    5850use lib $FindBin::Bin, "$FindBin::Bin/lib"; 
     
    9082 
    9183if ($FULLTRACE) { 
    92     eval { require Devel::Trace; }; 
     84    eval { 
     85        require Devel::Trace; 
     86    }; 
    9387    if ($@) { 
    9488        print "Error while initilizing --fulltrace while trying to load Devel::Trace:\n" 
    9589            . "$@Maybe Devel::Trace isn't installed?\n"; 
    96         exit 1; 
     90        exit(1); 
    9791    } 
    9892    push @cmd, '-d:Trace'; 
     
    121115push @cmd, '--help' if $USAGE; 
    122116 
    123 $DEBUG and print "Running " . join( ' ', @cmd ) . "\n"; 
     117if ( $DEBUG ) { 
     118    print "Running " . join( ' ', @cmd ) . "\n"; 
     119} 
     120 
     121if ( $USAGE ) { 
     122    usage(); 
     123} 
    124124 
    125125system(@cmd); 
    126126 
    127127sub vmsgfmt { 
    128     msgfmt( 
    129         {   in      => "$_[0]/share/locale/", 
    130             verbose => 0, 
    131         } 
    132     ); 
     128    msgfmt( { in => "$_[0]/share/locale/", verbose => 0 } ); 
    133129} 
    134130 
Note: See TracChangeset for help on using the changeset viewer.